Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zenject causes gameObjects destroying just after start #676

Open
mishatron opened this issue Jul 10, 2020 · 0 comments
Open

Zenject causes gameObjects destroying just after start #676

mishatron opened this issue Jul 10, 2020 · 0 comments

Comments

@mishatron
Copy link

mishatron commented Jul 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant