-
Notifications
You must be signed in to change notification settings - Fork 120
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
Additive Scenes #1
Comments
Hey Jan! This is a really good point, thanks for the issue. My main reason for not wanting to make TimerManager public is just that I don't want people to have to worry about managing it - ideally it would take care of spawning itself when you call Timer.Register for the first time, in a way that just works, so you don't have to worry about calling Timer.Register only after the TimerManager has been created. I'm not too experienced with additive scenes -- would it make sense for us to change the TimerManager spawning logic so it gets spawned into its own separate scene? |
That way the TimerManager won't be created inside one of the volatile scenes. |
So with additive scenes there's always one active scene, by default it is the last loaded scene. As far as I know the active scene is responsible for two things: it's the scene where GameObjects are instantiated, and it is the scene that provides the main data for the lighting. This second responsibility is what makes it a little less easy than it probably should be :) I haven't tried to create scenes at runtime yet, and I don't know if they get activated by default. It may be necessary to prevent that so the GI never gets switched and other instantiated GameObjects would appear in the correct scene. I know that it's possible to instantiate GameObjects in inactive scenes by using a parent, i.e. searching the desired parent with "GameObject.Find" and then using that reference. Maybe the easiest thing would be to have an optional script or prefab for users who use additive scenes. |
Hi!
I am using UnityTimer in the context of additive scenes. I have a main scene as a kind of manager scene that is never unloaded, but it cannot be the active scene most of the time. It needs to hold the TimerManager because the other scenes are all volatile. My workaround for now was to spawn a dummy timer at startup in the main scene and setting it to loop so it will always be there.
Would it be OK to make the TimerManager class public instead and add it manually from a different script in the main scene?
I made a little test and it seems to work, but I am not sure if there are going to be problems if TimerManager is public.
Thanks!
Jan
The text was updated successfully, but these errors were encountered: