Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            if (collision.GetComponent <PlayerController>().raging)
            {
                thrown = true;
            }
        }
        if (thrown)
        {
            if (collision.tag == "BossMonkey")
            {
                BossBehaviour bossBehaviour = collision.GetComponent <BossBehaviour>();
                if (bossBehaviour != null)
                {
                    bossBehaviour.Hit();
                }
                else
                {
                    collision.gameObject.GetComponent <Animation>().Play();
                    cutscene.StartScene();
                }

                if (rockSpawner != null)
                {
                    rockSpawner.SpawnRock();
                }
                Destroy(gameObject);
            }
            if (collision.tag == "FemaleMonkey")
            {
                //collision.GetComponent<FemaleMon>
            }
        }
    }