Hi Tony,
I'd like to be able to change the OnTransitionEnd Unity events when loading a scene on the fly depending on different situations (e.g., loading into a cutscene vs. just loading the scene normally). I was playing around with different options, but figured there's a "best" way to do this. Any thoughts? See the attached screenshot for specificity.
https://ibb.co/yqyC26d
Thanks as always for the fantastic support!
Change Transitions on the Fly for Standard Scene Transition Manager
-
- Posts: 113
- Joined: Sun Sep 20, 2020 8:21 pm
Re: Change Transitions on the Fly for Standard Scene Transition Manager
Hi,
The StandardSceneTransitionManager's methods are virtual so you can extend them with your own behavior. For example, say you have a special component CutsceneManager in your cutscene scenes:
You could override EnterScene() to call its method:
Then replace your StandardSceneTransitionManager component with your subclass.
The StandardSceneTransitionManager's methods are virtual so you can extend them with your own behavior. For example, say you have a special component CutsceneManager in your cutscene scenes:
Code: Select all
public class CutsceneManager : MonoBehaviour
{
public void PlayEntryCutscene() { ... }
}
Code: Select all
public class MySceneTransitionManager : StandardSceneTransitionManager
{
public override IEnumerator EnterScene()
{
var cutsceneManager = FindFirstObjectByType<CutsceneManager>();
if (cutsceneManager != null) cutsceneManager.PlayEntryCutscene();
yield return base.EnterScene();
}
}
-
- Posts: 113
- Joined: Sun Sep 20, 2020 8:21 pm
Re: Change Transitions on the Fly for Standard Scene Transition Manager
Worked like a charm! Thanks as always for your excellent, detailed, and superfast support.