Пример #1
0
 // Start is called before the first frame update
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("SnakeMain"))
     {
         //Application.LoadLevel(Application.loadedLevel);
         LoseMenu.Show();
     }
 }
Пример #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("SnakeMain"))
     {
         if (indx > 2)
         {
             LoseMenu.Show();
         }
     }
 }
Пример #3
0
        // Updates the state of the UI based on GameState.
        public void Update(GameState state)
        {
            // Sets the main menu UI.
            if (state == GameState.MainMenu)
            {
                mainMenu.Show();
            }
            else
            {
                mainMenu.Hide();
            }

            // Sets the gameplay UI.
            gameplay.SetActive(state == GameState.Gameplay);

            // Sets the pause menu UI.
            if (state == GameState.Paused)
            {
                pauseMenu.Show();
            }
            else
            {
                pauseMenu.Hide();
            }

            // Sets the lose menu UI.
            if (state == GameState.Lose)
            {
                loseMenu.Show();
            }
            else
            {
                loseMenu.Hide();
            }

            // Sets the win menu UI.
            if (state == GameState.Win)
            {
                winMenu.Show();
            }
            else
            {
                winMenu.Hide();
            }

            // Sets the stpre menu UI.
            if (state == GameState.Store)
            {
                storeMenu.Show();
            }
            else
            {
                storeMenu.Hide();
            }
        }
Пример #4
0
 void Death()
 {
     if (!inDeathPhase)
     {
         inDeathPhase = true;
         SoundManager.PlayDeathSound();
         LoseMenu.Show();
         rb.velocity = Vector3.zero;
         gameObject.SetActive(false);
         Instantiate(deathParticles, transform.position, Quaternion.identity);
     }
 }