Exemple #1
0
 public override void OnUpdate()
 {
     // 如果当前单位还未移动到目标敌人的位置,进行追击
     if (characterMono.Chasing(EnemryTransform.position, characterMono.characterModel.attackDistance))
     {
         //Debug.Log("正在进行攻击");
         // 追击完成后,对敌方进行攻击
         characterMono.Attack(ref isAttackFinish, EnemryTransform, enemryMono);
     }
 }
Exemple #2
0
        public override TaskStatus OnUpdate()
        {
            if (target.Value == null)
            {
                return(TaskStatus.Failure);
            }

            if (characterMono.Chasing(target.Value.transform.position, characterMono.characterModel.attackDistance))
            {
                if (characterMono.Attack(ref isAttackFinish, target.Value.transform, targetCharacterMono))
                {
                    return(TaskStatus.Success);
                }
            }
            if (targetCharacterMono.IsCanBeAttack())
            {
                return(TaskStatus.Running);
            }
            else
            {
                return(TaskStatus.Failure);
            }
        }