コード例 #1
0
 public void OnWinGame(GameMaster.GamePlayState gameState)
 {
     if (gameState == GameMaster.GamePlayState.WIN)
     {
         _winSong.text   = AudioFileLoader.Instance._songsData[AudioFileLoader.Instance._selectedSongIndex]._fileName;
         _winScore.text  = _score.ToString();
         _winHits.text   = _hits.ToString();
         _winMisses.text = _misses.ToString();
         _winShots.text  = _shots.ToString();
     }
 }
コード例 #2
0
 void StartSpawning(GameMaster.GamePlayState gameState)
 {
     if (gameState == GameMaster.GamePlayState.PLAYING)
     {
         Debug.Log("Spawning notes.");
         InvokeRepeating("SpawnNotes", 1f, _timeBetweenSpawns);
     }
     else
     {
         StopSpawning();
     }
 }
コード例 #3
0
 public void StartCountdown(GameMaster.GamePlayState gameState)
 {
     if (gameState == GameMaster.GamePlayState.COUNTDOWN)
     {
         _currentTime -= Time.deltaTime;
         if (_currentTime > 0)
         {
             _countdownText.text = ((int)_currentTime).ToString();
         }
         else
         {
             _currentTime = _startTime;
             GameMaster.Instance.GameState = GameMaster.GamePlayState.PLAYING;
             EventsManager.UpdateUIView();
             PopUpTextController.Initialize();
             AudioFileLoader.Instance.PlayCurrentSong(AudioFileLoader.Instance._selectedSongIndex);
         }
     }
 }
コード例 #4
0
    public void ToggleUIObjects(GameMaster.GamePlayState gameState)
    {
        switch (gameState)
        {
        case GameMaster.GamePlayState.MENU:
            _menuCanvas.SetActive(true);
            _levelCanvas.SetActive(false);
            _pausePanel.SetActive(false);
            _countdownPanel.SetActive(false);
            _winPanel.SetActive(false);
            _losePanel.SetActive(false);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            break;

        case GameMaster.GamePlayState.COUNTDOWN:
            _menuCanvas.SetActive(false);
            _levelCanvas.SetActive(true);
            _countdownPanel.SetActive(true);
            _pausePanel.SetActive(false);
            _winPanel.SetActive(false);
            _losePanel.SetActive(false);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            break;

        case GameMaster.GamePlayState.PLAYING:
            _menuCanvas.SetActive(false);
            _levelCanvas.SetActive(true);
            _pausePanel.SetActive(false);
            _countdownPanel.SetActive(false);
            _winPanel.SetActive(false);
            _losePanel.SetActive(false);
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;
            break;

        case GameMaster.GamePlayState.PAUSE:
            _menuCanvas.SetActive(false);
            _levelCanvas.SetActive(true);
            _pausePanel.SetActive(true);
            _countdownPanel.SetActive(false);
            _winPanel.SetActive(false);
            _losePanel.SetActive(false);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            break;

        case GameMaster.GamePlayState.WIN:
            _menuCanvas.SetActive(false);
            _levelCanvas.SetActive(true);
            _pausePanel.SetActive(false);
            _countdownPanel.SetActive(false);
            _winPanel.SetActive(true);
            _losePanel.SetActive(false);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            break;

        case GameMaster.GamePlayState.LOSE:
            _menuCanvas.SetActive(false);
            _levelCanvas.SetActive(true);
            _pausePanel.SetActive(false);
            _countdownPanel.SetActive(false);
            _winPanel.SetActive(false);
            _losePanel.SetActive(true);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            break;
        }
    }