Page 1 of 1
Exceptions for scene transition manager
Posted: Mon Mar 21, 2022 10:42 pm
by Fitbie
Hi, I am using the standart scene transition manager. And I have a question: there are a couple of scenes where I would like to use a different loading screen. Literally 4-5. I don't want to make a separate canvas for them, but in scene transition manager there is no possibility to specify "exceptions". What to do? Create a separate canvas? Or may I keep scene transition manager on each scene? Thanks!
Re: Exceptions for scene transition manager
Posted: Tue Mar 22, 2022 9:05 am
by Tony Li
Hi,
The Standard Scene Transition Manager should be on the same GameObject as the Save System component. You shouldn't have a separate Standard Scene Transition Manager for each scene. Here are two options:
1. Before changing scenes, set the Standard Scene Transition Manager's loadingSceneName value. Example:
Code: Select all
(SaveSystem.sceneTransitionManager as StandardSceneTransitionManager).loadingSceneName = "Some Scene";
2. Or write a subclass of StandardSceneTransitionManager that overrides the LeaveScene() method. Add your subclass to the Save System GameObject in place of the original StandardSceneTransitionManager. Example:
Code: Select all
public class CustomSceneTransitionManager : StandardSceneTransitionManager
{
public override IEnumerator LeaveScene()
{
loadSceneName = "Some Scene";
yield return base.LeaveScene();
}
}