public static void GotoScene(string index, float fadeOut = 0.0f, float fadeIn = 0.0f) { if (fadeOut > Mathf.Epsilon || fadeIn > Mathf.Epsilon) { LevelTransition.LoadLevel(index, fadeOut, fadeIn, Color.black); } else { SceneManager.LoadScene(index); } }
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); }
IEnumerator SetOutTransition() { // Set the fade delay levelTransition.fadeDelay = fadeDelay; // Set the loading bar status levelTransition.useLoadingBar = useLoadingBar; // Set the async mode levelTransition.loadAsyncDirect = loadAsyncDirect; // Wait for X amount of seconds before triggering the animation yield return(new WaitForSecondsRealtime(splashDelay)); // Deativate the canavs's levelTransition.simpleFade.gameObject.SetActive(false); levelTransition.sideWipe.gameObject.SetActive(false); // Set the out transition SetTransitionOut(); // Load the scene levelTransition.LoadLevel(sceneToLoad); }
//-------------------------------------------------- // 接口方法 //-------------------------------------------------- public void LoadLevel(ALevelMap map, LoadMode mode) { LevelTransition.LoadLevel(map, mode); }