Esempio n. 1
0
 public void PlaySceneNight()
 {
     this.name           = ESceneNames.scene_night;
     this.imgSea.color   = new Color(this.imgSea.color.r, this.imgSea.color.g, this.imgSea.color.b, 0f);
     this.imgField.color = new Color(this.imgField.color.r, this.imgField.color.g, this.imgField.color.b, 0f);
     this.imgNight.color = new Color(this.imgNight.color.r, this.imgNight.color.g, this.imgNight.color.b, 255f);
 }
Esempio n. 2
0
 public void LoadScene(ESceneNames scene_name)
 {
     if (next_scene == scene_name)
     {
         return;
     }
     if (!gameObject.activeSelf)
     {
         gameObject.SetActive(true);
     }
     next_scene = scene_name;
     SwitchState(ESceneState.FadeOut);
 }
        private IEnumerator LoadSceneTransitions(ESceneNames sceneName)
        {
            faderAnimator.SetBool(VisibleVariable, true);
            yield return(new WaitForEndOfFrame());

            yield return(new WaitForSeconds(fadingClip.length));

#if UNITY_4_6
            //LoadLevelAsync wasn't in the free version of Unity in 4.6 so did this for compatibility reasons
            Application.LoadLevel(sceneName.ToString());
            while (Application.isLoadingLevel)
            {
                yield return(new WaitForEndOfFrame());
            }
#else
            yield return(Application.LoadLevelAsync(sceneName.ToString()));
#endif
            faderAnimator.SetBool(VisibleVariable, false);
        }
Esempio n. 4
0
 public void LoadScene(ESceneNames sceneName)
 {
     Time.timeScale = 1;
     StartCoroutine(LoadSceneTransitions(sceneName));
 }
 public void LoadScene(ESceneNames sceneName)
 {
     StartCoroutine(LoadSceneTransitions(sceneName));
 }