Beispiel #1
0
 public void ReturnToGame()
 {
     UIAudioPlayer.PlayPositive();
     GameSystem.Instance.StartTimer();
     gameObject.SetActive(false);
     Controller.Instance.DisplayCursor(false);
 }
Beispiel #2
0
    public void OpenEpisode()
    {
        if (LevelSelectionUI.Instance.IsEmpty())
        {
            return;
        }

        UIAudioPlayer.PlayPositive();
        gameObject.SetActive(false);
        LevelSelectionUI.Instance.DisplayEpisode();
    }
    public void Init()
    {
        for (int i = 0; i < GameDatabase.Instance.episodes.Length; ++i)
        {
            var ep = GameDatabase.Instance.episodes[i];

            Button b = Instantiate(ButtonPrefab);
            Text   t = b.GetComponentInChildren <Text>();

            t.text = $"Episode {i + 1}";

            var i1 = i;
            b.onClick.AddListener(() => { UIAudioPlayer.PlayPositive(); OpenEpisode(i1); });
            b.transform.SetParent(ButtonListPlace);

            m_EpisodeButtons.Add(b);

            m_LevelButtons.Add(new List <Button>());

            for (int j = 0; j < ep.scenes.Length; ++j)
            {
                Button levelB = Instantiate(ButtonPrefab);
                t = levelB.GetComponentInChildren <Text>();

                var j1 = j;
                levelB.onClick.AddListener(() =>
                {
#if UNITY_EDITOR
                    EditorSceneManager.LoadSceneInPlayMode(ep.scenes[j1], new LoadSceneParameters());
#else
                    SceneManager.LoadScene(ep.scenes[j1]);
#endif
                    Time.timeScale = 1;
                });

                t.text = $"Level {j + 1}";

                levelB.transform.SetParent(ButtonListPlace);
                m_LevelButtons[i].Add(levelB);
            }
        }
    }
Beispiel #4
0
 public void NextLevel()
 {
     UIAudioPlayer.PlayPositive();
     GameSystem.Instance.NextLevel();
 }
Beispiel #5
0
 public void OpenEpisode()
 {
     UIAudioPlayer.PlayPositive();
     gameObject.SetActive(false);
     LevelSelectionUI.Instance.DisplayEpisode();
 }