예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("wall") || other.CompareTag("cubeFloor"))
        {
            GameOver();
        }

        else if (other.CompareTag("Point"))
        {
            PlayerScore++;
            if (PlayerScore > PlayerMaxScore)
            {
                PlayerMaxScore++;
            }
            ScoreController.SetPlayerScore();
            ScoreController.AddTimeGameCountdown();
            AudioCoinSound.Play();

            if (!PulseBar.IsTimeCharged)
            {
                PulseBar.PulseCoinAdd += .3f;
            }

            if (PlayerScore % 5 == 0)
            {
                GameController.StartCubeAnimation();
                FloorController.ChangeLevelDifficult(5);

                if (PlayerScore % 10 == 0)
                {
                    GameController.DestroyAllWall();
                }
            }
            SpawnController.SpawnPointSphere();
            Destroy(other.gameObject);
        }
    }