-
Notifications
You must be signed in to change notification settings - Fork 5
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
TransitionToScene (and variants) only unload the current active scene. #45
Comments
Hi @Clozent, thanks for your report. I agree with you, simply unloading the active scene only covers a simple use case. It does not need to break compatibility though, we can just add new method alternatives for scene transition, such as:
void TransitionToScenesAsync(ILoadSceneInfo[] targetScenes, int setIndexActive, ILoadSceneInfo[] unloadScenes, ILoadSceneInfo intermediateSceneReference = null)
void TransitionToScenesAsync(ILoadSceneInfo[] targetScenes, int setIndexActive, bool unloadAllScenes, ILoadSceneInfo intermediateSceneReference = null) With the new methods, you'd have three options for transition:
What do you think? If you agree, I'll start working on it right away. |
Hi, overall, I think these new methods are a good way to solve this problem. One thing is bugging me, though: the method Instead, I think it would be best to make the behavior a separate method, such as |
You're right, it'd be better to introduce a new method for unloading all scenes. So to summarize, two new methods will be added:
Not so sure about the names yet, but that's the scope. I'll start working on it today. |
Adding a development note for my future self: Check whether including #44 improves the experience when using |
When using
TransitionToSceneAsync()
to transition between scenes, I expected that the scene loader would unload all scenes under it's management when transitioning. Instead, no scene was unloaded at all, because I didn't make the scene I wished to unload the active scene.This is a problem.
Unloading only the active scene is extremely limiting, as there is currently no way to transition from:
What I propose is that
ISceneLoader.TransitionToScene()
andISceneLoader.TransitionToScenes()
would accept a scene or an array of scenes to unload, and that the implementations of these methods inSceneLoaderAsync
,SceneLoaderCoroutine
, andSceneLoaderUniTask
would unload all managed scenes by default.I know this will break backwards compatibility, but it doesn't seem like much of a problem, seeing as this package already broke some backwards compatibility in the past.
The text was updated successfully, but these errors were encountered: