コード例 #1
0
    /// <summary>
    /// Causes the ArmyUnit to take damage and die if hp falls to or below 0
    /// </summary>
    /// <param name="amt">Quantity of damage to take, or negative value to heal</param>
    public override void TakeDamage(float amt)
    {
        base.TakeDamage(amt);

        if (hp == 0)
        {
            attackAnimator.Stop();
            allyManager.KillUnit(this);
        }
    }