예제 #1
0
    private void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.tag == "SkyObject")
        {
            GameManager.instante.gameStates = GameManager.GameStates.playerDied;
            this.gameObject.SetActive(false);

            audio.Play();
            // uIManager.SaveGameData();
            gameUi.ActivateRestartUI();
            gameUi.SaveGameData();
            // uIManager.CarCrashSound();
        }

        else if (Other.tag == "GroundObject")
        {
            GameManager.instante.gameStates = GameManager.GameStates.playerDied;
            this.gameObject.SetActive(false);

            audio.Play();
            // uIManager.SaveGameData();
            gameUi.ActivateRestartUI();
            gameUi.SaveGameData();
            // uIManager.CarCrashSound();
        }

        else if (Other.tag == "DeadZone")
        {
            GameManager.instante.gameStates = GameManager.GameStates.playerDied;
            this.gameObject.SetActive(false);

            audio.Play();
            gameUi.ActivateRestartUI();
        }
    }