Exemplo n.º 1
0
    //Called when the wave collides with a coin or with an obstacle
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Obstacle")
        {
            levelGenerator.AddExplosionParticle(other.transform.position);
            other.GetComponent <Renderer>().enabled   = false;
            other.GetComponent <Collider2D>().enabled = false;

            if (other.name != "Torpedo")
            {
                lastObstacle = other.transform;
            }
            else
            {
                other.transform.Find("TorpedoFire").gameObject.SetActive(false);
            }
        }
    }
Exemplo n.º 2
0
 //Adds an explosion to the level
 public void Collision(string collidedWith, Vector2 contactPoint)
 {
     levelGenerator.AddExplosionParticle(contactPoint);
     missionManager.CollisionEvent(collidedWith);
 }