Exemple #1
0
        public IEnumerator ReturnToLevelSelectionCoroutine()
        {
            if (sceneTransitionMask != null)
            {
                sceneTransitionMask.willFadeIn = true;
                sceneTransitionMask.GetComponent <Image>().raycastTarget = true; // Block button interactions
                while (sceneTransitionMask.IsFading)
                {
                    yield return(null);
                }
            }

            SceneManager.LoadScene("LevelSelection");
        }
Exemple #2
0
        public void OnStart()
        {
            var level = CytoidApplication.CurrentLevel;

            background                       = GameObject.FindGameObjectWithTag("Background");
            backgroundOverlayMask            = GameObject.Find("BackgroundOverlayMask").GetComponent <AlphaMask>();
            backgroundOverlayMask.max        = (int)PlayerPrefs.GetFloat("background dim", 17) / 20.0f;
            backgroundOverlayMask.willFadeIn = true;

            var canvas = backgroundOverlayMask.GetComponent <Canvas>();

            canvas.overrideSorting  = true;
            canvas.sortingLayerName = "GameBackground";
            canvas.sortingOrder     = 1;

            var gameObject = GameObject.Find("SceneTransitionMask");

            if (gameObject != null)
            {
                sceneTransitionMask = GameObject.Find("SceneTransitionMask").GetComponent <AlphaMask>();
            }

            gameObject = GameObject.Find("TitleText");

            if (gameObject != null)
            {
                titleText      = gameObject.GetComponent <Text>();
                titleText.text = level.title;
            }

            if (background != null)
            {
                canvas = background.GetComponent <Canvas>() == null
                    ? background.AddComponent <Canvas>()
                    : background.GetComponent <Canvas>();

                canvas.overrideSorting  = true;
                canvas.sortingLayerName = "GameBackground";
                canvas.sortingOrder     = 0;
            }

            if (DisplayDifficultyView.Instance != null)
            {
                DisplayDifficultyView.Instance.SetDifficulty(level,
                                                             level.charts.Find(it => it.type == CytoidApplication.CurrentChartType));
            }
        }
Exemple #3
0
 private IEnumerator GoBackToLevelSelectionCoroutine()
 {
     sceneTransitionMask.willFadeIn = true;
     sceneTransitionMask.GetComponent <Image>().raycastTarget = true; // Block button interactions
     while (sceneTransitionMask.IsFading)
     {
         yield return(null);
     }
     foreach (DictionaryEntry entry in NoteViews)
     {
         var noteView = entry.Value as NoteView;
         if (noteView == null)
         {
             continue;                   // Already cleared/destroyed
         }
         Destroy(noteView.gameObject);
     }
     SceneManager.LoadScene("LevelSelection");
 }