Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Collectable")
        {
            _uiController.Collectable();
            Destroy(other.gameObject);
        }

        if (other.tag == "Check_Point_One")
        {
            saveCheckPoint(other);
        }

        if (other.tag == "Check_Point_Two")
        {
            saveCheckPoint(other);
            _enController.HideLevel(0);
        }

        if (other.tag == "Check_Point_Three")
        {
            _gameController.EndScene();
        }

        if (other.tag == "Dead_Zone")
        {
            respawnPlayer();
        }
    }
Beispiel #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Collectable")
        {
            _uiController.Collectable();
            AudioSource.PlayClipAtPoint(PickUpClip, other.transform.position);
            Destroy(other.gameObject);
        }

        if (other.tag == "Finish")
        {
            _gameController.StartNextScene();
        }
    }