I'm using Zenject for UnityEngine project and I'm trying to write a unit test for my MenuSystem class but I'm constantly getting error System.Security.SecurityException : ECall methods must be packaged into a system module.
This is the stack…
I am working on a Unity project using the Extenject / Zenject dependency injection framework, and I am having trouble writing unit tests for custom prefab factories.
I have an ArchitectController that needs to instantiate different prefab variants…
I ran into the problem of binding components from a child component, a solution to this problem is possible?
At the moment I have a solution, but it is inconvenient, you need to forward all methods through 1 component. Example:
public inteface…
I have an embedded Player class.
public class PlayerInstaller : MonoInstaller
{
[SerializeField] private GameObject _playerPrefabs;
public override void InstallBindings()
{
var player =…
I'd like to have a class that works as a collection for another class. So let's say I have FooBarCollection that has a collection of named FooBarItems. I can bind the FooBarCollection and injecting it works. The problem is that in order to keep…
I started to learn Zenject + Unity. I learned the Zenject readme but I have no unity experience I need shared data between scenes and I want to have some code over the scene.
I try to inject some GameData class in two scenes.
My scenes have…
I have an intermittent bug reported by a few users which I cannot fix or replicate because it doesn’t crash or freeze the app, thus no crash report is generated.
Here is the flow of my app when it works:
In the Home screen, user presses Continue…
I am building an unlimited running car game and for this, I have to spawn other cars randomly.
Here is my default installer code:
using UnityEngine;
using Zenject;
public class DefaultInstaller : MonoInstaller
{
//Total Car Objects
public…
I have next structure:
TestFacade is a GameObject that gets pooled.
public class TestFacade : MonoBehaviour, IPoolable, IDisposable
{
public class Factory : PlaceholderFactory { }
public class Pool :…
I have GameObjectContext which is supposed to get a binding from another GameObjectContext to get the same instance of the contracttype. Now it looks like…
I'm new at Zenject(Extenject).
My dev environment: Win10, Unity2020, Extenject 9.2.0
Here is my question:
In installer bind the class
Container.Bind().AsCached();
Inject it at classA
private AccountInfo accountInfo; …
I working on menu using MVP pattern, so I have 2 singelton presenters. First one is main menu presenter, second is settings menu presenter. First presenter(main menu pres) needs to refernse second (settings pres) and vice versa seconds needs to…
I am new in Zenject world. I am modifying a sample code SampleGame1 (Beginner) (you can check the full example here) on Zenject in ShipState by implementing the Iinitializable, the existing one is IDisposable, so there are two implemented Interfaces…
Zenject doesn't work with Behavior Disiner. When injected into Action,injection does not occur.
[Inject]
public void Constructor(GameStateHandler gameStateHandler)
{
gameStateHandler.OnGameStart(() => _isGameStart = true);
…