public static void FadeToBlack(float durationSeconds) { GameObject camera = GameObject.Find("Camera"); SceneDirection sd = camera.GetComponent <SceneDirection>(); sd.FadeToBlack(durationSeconds); }
IEnumerator DoTransition() { GameObject camera = GameObject.Find("Main Camera"); SceneDirection sd = camera.GetComponent <SceneDirection>(); sd.FadeToBlack(fadeDuration); yield return(new WaitForSeconds(fadeDuration)); Globals.ResetMinerals(); Application.LoadLevel(nextLevelName); }
IEnumerator OnMouseDown() { Globals.currentMinerals = 0; Globals.maxMinerals = 0; SceneDirection director = GetComponent <SceneDirection>(); director.FadeToBlack(1.0f); yield return(new WaitForSeconds(1.0f)); Application.LoadLevel("Kentta0Assy"); }