public float fadeSpeed = 1.5f; // Speed that the screen fades to and from black. #endregion Fields #region Methods public void EndScene() { Controller.DisableInput(); // Make sure the texture is enabled. GetComponent<GUITexture>().enabled = true; CurrentState = FadeInOutState.FadeOut; // Start fading towards black. FadeToBlack(); // If the screen is almost black... if (GetComponent<GUITexture>().color.a >= 0.95f) { CurrentState = FadeInOutState.None; Controller.EnableInput(); } }
private void StartScene() { if (Controller != null)Controller.DisableInput(); // Fade the texture to clear. FadeToClear(); // If the texture is almost clear... if (!(GetComponent<GUITexture>().color.a <= 0.05f)) return; // ... set the colour to clear and disable the GUITexture. GetComponent<GUITexture>().color = Color.clear; GetComponent<GUITexture>().enabled = false; CurrentState = FadeInOutState.None; if (Controller != null) { Controller.EnableInput(); if (!Statics.TimelineChanged) Controller.SignalLoadComplete(); } }