I think it's better to formulate the problem via code. I have a BaseClass.
public abstract class BaseUnit {
[System.Serializable]
public class Settings
{
}
}
And some derived classes, for example.
public class Archer : BaseUnit…
I have a Monobehaviour object BaseUnit which can have some states, so I created
states factory, like in the Zenject example projects, but my question is how to pass reference of this BaseUnit when I create this factory of states for this…
I'm trying to load a prefab during runtime in one particular moment at my state machine. But I get this exception in runtime. All the scenes are validate with the Ctrl Left+Maj Left+V shortcut.
The context of the problem
My state machine is bind…
I'm using the Mapbox SDK and RoadArchitect and trying to build some game initialization code that uses Mapbox to generate a list of vectors, then take that list of vectors and call functions in Road Architect to generate road GameObjects. In order…
I use Factories to create GameObjects from prefabs.
MenuScreen (prefab root game object)
* MenuScreenComponent <- inject ScreensNavigator
- Button (game object)
* ButtonSoundBehaviour <- inject AssetsProvider
In the…
Previous question: link
In my application I have three layers:
Data (Entities and Data Access Objects)
Model (Managers)
Presentation (Views)
How can I setup Game Object Context that Model layer will include all Data layer dependencies and…
Good day.
I have an interface:
public interface IRepository
{
//Stuff
}
and an implementation:
class Repository : IRepository
{
//Stuff implementation
}
now I would like to bind it all together in a container.
I found Zenject to be…
How do I create a factories with zenject with multiple parameter overloaded Create methods (or how to solve this problem differently)?
I want to be able to
var x = factory.Create("bla bla");//string
x = factory.Create();//parameterless
x =…
I have a ScriptableObjectInstaller
public class Settings : ScriptableObjectInstaller
{
[Header("Gravity settings")] public GravityHandler.Settings GravitySettings;
[Header("Movement settings")] public MovementHandler.Settings…
How can you add a component to a gameobject?
The normal path of
GameObject obj = _factory.Create(); // Creates from prefab
HasScore score = obj.AddComponent(); // attach the component
The problem is that HasScore component is not going…
I am new to Zenject and I am trying to bind an interface to a MonoBehaviour like below. In this case, I am trying to simulate to play sound inside Player.
using UnityEngine;
using Zenject;
public class GameInstaller : MonoInstaller
{
public…
I'm working on a Unity3D project using Zenject for dependency injection. In my project, i have a UpgradeCardButton component which is injected with a ButtonUpgradeCommand object.
ButtonUpgradeCommand is constructed with an object of type…
I have ProjectContext with some installers for global dependencies. One of the installers:
public class StateMachineInstaller : MonoInstaller
{
public override void InstallBindings()
{
BindStateFactory();
…
I have a Character class. Its mono and have CharacterInstaller. And I'm using MonoPoolableMemoryPool for Character pool. But I have to bind derived class by character runtime parameters. Is there any way to do that?
public enum Type
{
…