Exemplo n.º 1
0
    /// <summary>
    /// Handle collisions between the player and the bosses bullets
    /// </summary>
    public void CollideShipBossBullets()
    {
        HealthManager     health       = Ship.GetComponent <HealthManager> ();
        List <GameObject> bullets      = bulletManager.BossBullets;
        CollisionCircle   shipCollider = Ship.GetComponent <CollisionCircle> ();

        if (!health.Immune)
        {
            for (int i = bullets.Count - 1; i >= 0; i--)
            {
                if (shipCollider.TestCollisionCircle(bullets [i].GetComponent <CollisionCircle> ()))
                {
                    health.Hit();
                    bulletManager.DestroyBossBullets(i);
                }
            }
        }
    }