Ejemplo n.º 1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Pick Up"))
        {
            other.gameObject.SetActive(false);
            gameFlowController.IncreaseScore();
        }

        if (other.gameObject.CompareTag("Block"))
        {
            Camera.main.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); // stop camera from moving in case
            transform.gameObject.SetActive(false);
            Instantiate(explosion, transform.position, transform.rotation);
            this.gameFlowController.SetGameOver();
        }
    }