Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Pivot" && this.gameObject.tag == "Camera Switch")               // CHANGE CAMERA POSITION
        {
            cameraManager.ChangeCamera();
            Destroy(this.gameObject);
        }
        if (other.gameObject.tag == "Pivot" && this.gameObject.tag == "TriggerSpawn")                   // SPAWN ENEMIES
        {
            SpawnerController.SpawnWave(this.transform.position, this.gameObject.name);
            Destroy(this.gameObject);
        }
        if (gameObject.tag == "End_Level" && other.gameObject.tag == "Pivot")
        {
            GameLevelManager.HighScore();
        }
        if (gameObject.tag == "End_Level" && other.gameObject.tag == "VFX")
        {
            if (GameLevelManager.GetSceneName() == "World1_1")
            {
                return;
            }
            else
            {
                GameLevelManager.LoadNextLevel();
            }
        }

        if (gameObject.name == "HighScores")
        {
            ToggleScoreONOFF();
        }

        if (gameObject.name == "Head" && other.gameObject.tag == "VFX")
        {
            Avatar.Stun();
        }
        if (gameObject.name == "tail" && other.gameObject.tag == "VFX")
        {
            Avatar.MakeAvatarJump();
        }


        if (gameObject.name == "Continue" && other.gameObject.tag == "VFX")
        {
            GameLevelManager.Continue();
            UIController.ResetScore();
        }
        if (gameObject.name == "Quit" && other.gameObject.tag == "VFX")
        {
            GameLevelManager.ReturnToMenu();
            UIController.ResetScore();
        }

        if (gameObject.name == "Crystal")
        {
            gameObject.GetComponent <ItemControl>().DamageBoss();
        }
    }