public override void StartTransition( Transform playerTransform, Transform controller, Vector3 target) { player = playerTransform; targetPosition = target; fader.FadeToColor(); isTransitioning = true; }
private IEnumerator SceneLoadCoroutine(string id) { ScreenFade.FadeToColor(); yield return(new WaitForSeconds(ScreenFade.FadeTime)); if (loading) { Debug.LogWarning("Unable to load scene while a scene is already loading"); yield break; } loading = true; #if UNITY_5_2 AsyncOperation sceneLoad = Application.LoadLevelAsync(id); #else AsyncOperation sceneLoad = SceneManager.LoadSceneAsync(id); #endif while (!sceneLoad.isDone) { yield return(null); } loading = false; }