Ejemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag.Equals("Fly"))
     {
         Destroy(other.gameObject.GetComponent <Flocking>());
         Flocking.DestroyFlockMember(other.gameObject);
         Destroy(other.gameObject);
         PlayerInfo.IncrementScore();
     }
 }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag.Equals("Fly"))
        {
            Flocking flocker = other.gameObject.GetComponent <Flocking>();

            if (flocker != null)
            {
                Destroy(other.gameObject.GetComponent <Flocking>());
                Flocking.DestroyFlockMember(other.gameObject);
            }

            Destroy(other.gameObject);

            transform.parent.gameObject.GetComponent <PlayerInfo>().IncrementScore();

            if (survivalMode)
            {
                FlyPlayerInfo.DecrementFlyCount();
            }
        }
    }