Skip to content

Zenject causes gameObjects destroying just after start #676

@mishatron

Description

@mishatron

I am using ProjectContext with next installer:

[CreateAssetMenu(fileName = "DependenciesInstaller", menuName = "Installers/DependenciesInstaller")]
public class DependenciesInstaller : ScriptableObjectInstaller<DependenciesInstaller>
{
    public override void InstallBindings()
    {
        Container.Bind<IGameRepository>().To<GameRepositoryMock>().AsSingle().NonLazy();
        Container.Bind<IAuthRepository>().To<AuthRepository>().AsSingle().NonLazy();
    }
}

On one of the scenes I have some objects that use

public class LettersPanelController : BaseListenableMonoBehaviour
{
    [Inject]
    private readonly IGameRepository gameRepository;
...
}

And just near 1 sec after starting the scene i got message that my object (LettersPanelController ) was destroyed.
It is some error of ProjectContext, I suppose, because before it, I used only SceneContext(with installer) and it worked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions