Esempio n. 1
0
        private void OnDamaged(Damage damage)
        {
            if (!string.IsNullOrEmpty(damage.source))
            {
                data.currentTarget = damage.source;
                if (currentRoutine != NPCRoutine.Combat)
                {
                    ActivateRoutine(NPCRoutine.Combat);
                }
            }

            if (data.health - damage.amount <= 0)             // Dying
            {
                OnDeath?.Invoke();
                CharacterPool.GetCharacter(damage.source)?.Killed(gameObject.name);
            }
        }
Esempio n. 2
0
 private CharacterBase GetTarget()
 {
     return(CharacterPool.GetCharacter(data.currentTarget));
 }