-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Multiple instances of singleton? #707
Comments
I fixed it by removing RegisterEntrypoint, adding a monobehaviour called "StartCaller" that calls Start instead. I dont think this is how its supposed to work..? |
I don't think you're supposed to use both You can use |
You asked it to register 2 instances, and you got two. That's how it's supposed to work because VContainer supports collections.
|
Try using a GameEntryPoint to initialize GameManager and register GameEntryPoint in the RootLifetimeScope.
|
I've added a gameObject to the VContainerSettings and attached my rootLifetimeScope
In that rootLifetimeScope:
Then in one of my scenes I've got a "PlayableSceneScope" which I've put on a gameObject, changed parent to the rootLifetimeScope.
In that PlayableSceneScope i do:
In the ServerConnectionController
In the GameManager, I've got a start method:
If i print that value from inside GameManager its fine,
if i try to access it from ServerConnectionController which was registered by the child of the rootLifeTimeScope that value is 0, not 15, why?
The text was updated successfully, but these errors were encountered: