Exemplo n.º 1
0
        //----------------------------------------------------------------------------
        //            TakeDamage
        //----------------------------------------------------------------------------

        #region TakeDamage
        public IEnumerator TakeDamage(AttackRoll attackRoll)
        {
            int damage = attackRoll.MyDamageData.GetDamage();

            MyHasHealth.TakeDamage(attackRoll.MyDamageData.GetDamage());

            if (MyHasHealth.GetHealth() != 0)
            {
                yield return(StartCoroutine(MyNarrator.Damage()));
            }
            else
            {
                yield return(StartCoroutine(MyCanDie.TakeAttack(attackRoll)));
            }
        }