public override void OnUpdate() { // 如果当前单位还未移动到目标敌人的位置,进行追击 if (characterMono.Chasing(EnemryTransform.position, characterMono.characterModel.attackDistance)) { //Debug.Log("正在进行攻击"); // 追击完成后,对敌方进行攻击 characterMono.Attack(ref isAttackFinish, EnemryTransform, enemryMono); } }
public override TaskStatus OnUpdate() { if (target.Value == null) { return(TaskStatus.Failure); } if (characterMono.Chasing(targetCharacterMono.transform.position, characterMono.characterModel.attackDistance)) { return(TaskStatus.Success); } return(TaskStatus.Failure); }
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); } }