private void OnCollisionEnter2D(Collision2D collision)
 {
     if (bird != null && !bird.IsDead())
     {
         bird.Dead();
     }
 }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        BirdScript bird = collision.gameObject.GetComponent <BirdScript>();

        if (bird)
        {
            Collider2D collider = GetComponent <Collider2D>();
            if (collider)
            {
                collider.enabled = false;
            }

            bird.Dead();
        }

        BulletScript bullet = collision.gameObject.GetComponent <BulletScript>();

        if (bullet)
        {
            GameObject destroyParticle = Instantiate(particle, transform.position, Quaternion.identity);
            Destroy(destroyParticle, 1.5f);
            Destroy(this.gameObject);
            Destroy(bullet.gameObject);
        }
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        BirdScript bird = collision.gameObject.GetComponent <BirdScript>();

        if (bird)
        {
            bird.Dead();
        }
    }