Example #1
0
    IEnumerator TakeCollision()
    {
        if (canTakeCollision)
        {
            shields = shields - 50;
            if (shields < 0)
            {
                armor   = armor + shields;
                shields = 0;
            }

            if (armor < 0)
            {
                Die();
            }
            canTakeCollision = false;
            interfaceController.DamageEffect();
            yield return(new WaitForSeconds(.1f));

            canTakeCollision = true;
        }
    }