I'm trying to inject plain C# class into Mobobehaviour, but an "Unable to resolve 'HeightSystem' while building object with type 'UserDirijible'. Object graph: UserDirijible" exception is thrown.
namespace Systems {
public class HeightSystem
{
...
}
using Zenject;
namespace Systems {
public class HeightSystemInstaller : MonoInstaller<HeightSystemInstaller>
{
public override void InstallBindings()
{
Container.BindInstance<HeightSystem>(new HeightSystem()).AsSingle();
}
}
}
//UserDirijible.cs
[Inject]
public Systems.HeightSystem heightSystem;
HeightSystemInstaller is attached to empty object in scene. What is may cause this error? Previously, Monobehaviour classes injection was work fine. I was mostly working with Dagger 2 and till now can not find the piece of documentation about injection plain C# classes into Monobehaviours