public void Attack(HeroAttackType.Type attackType, Action animationCallback)
        {
            _attackAnimationCallback = animationCallback;
            switch (attackType)
            {
            case HeroAttackType.Type.Melee:
                _animator.SetTrigger(MeleeAttackTrigger);
                break;

            case HeroAttackType.Type.Range:
                _animator.SetTrigger(RangeAttackTrigger);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(attackType), attackType, null);
            }
        }
Example #2
0
 public Sprite GetAttackIcon(HeroAttackType.Type type)
 {
     return(_attackIcons.Find(config => config.Type == type).Icon);
 }