// Set your static transition out settings here public static void SetStaticTransitionOut(TransitionsOut transitionsOut) { // Add your extra transition animations here switch (transitionsOut) { case TransitionsOut.SimpleFade: _levelTransition.animationName = "SimpleFade"; _levelTransition.simpleFade.gameObject.SetActive(true); _levelTransition.simpleFade.gameObject.GetComponent <Animator>().runtimeAnimatorController = _levelTransition.transitionsList[0].animatorController; _animator = _levelTransition.simpleFade.gameObject.GetComponent <Animator>(); break; case TransitionsOut.SideWipe: _levelTransition.animationName = "SideWipe"; _levelTransition.sideWipe.gameObject.SetActive(true); _levelTransition.sideWipe.gameObject.GetComponent <Animator>().runtimeAnimatorController = _levelTransition.transitionsList[1].animatorController; _animator = _levelTransition.sideWipe.gameObject.GetComponent <Animator>(); break; default: break; } }
static IEnumerator SetStaticOutTransition(string sceneToLoad, float splashDelay, float fadeDelay, TransitionsOut tOut, bool useLoadingBar, bool loadAsyncDirect) { _levelTransition.fadeDelay = fadeDelay; _levelTransition.useLoadingBar = useLoadingBar; _levelTransition.loadAsyncDirect = loadAsyncDirect; yield return(new WaitForSecondsRealtime(splashDelay)); _levelTransition.simpleFade.gameObject.SetActive(false); _levelTransition.sideWipe.gameObject.SetActive(false); SetStaticTransitionOut(tOut); _levelTransition.LoadLevel(sceneToLoad); }
public static void LoadLevel(string sceneToLoad, float splashDelay, float fadeDelay, TransitionsOut tOut, bool useLoadingBar, bool loadAsyncDirect) { _levelTransition.StartCoroutine(SetStaticOutTransition(sceneToLoad, splashDelay, fadeDelay, tOut, useLoadingBar, loadAsyncDirect)); }