2024-10-17 00:46:27 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Game.Component.EnemyFSM_AI
|
|
|
|
|
|
{
|
|
|
|
|
|
public class FollowDuration : EnemyFSMState
|
|
|
|
|
|
{
|
|
|
|
|
|
private AttackTimer _attackTimer;
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnEnter ()
|
|
|
|
|
|
{
|
2024-10-18 00:23:04 +08:00
|
|
|
|
this.Entity.AnimState.SetState (EnemyAnimStateType.Attack);
|
2024-10-17 00:46:27 +08:00
|
|
|
|
this.Entity.UpdateSpeedState (true);
|
|
|
|
|
|
this._attackTimer = this.Entity.GetComponent<AttackTimer> ();
|
|
|
|
|
|
this._attackTimer.StartAttack (this.Entity.EndAttack);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnUpdate ()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this._attackTimer.IsRunning)
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.Log ("开始追逐!");
|
|
|
|
|
|
SetAiTarget (MapContent.Instance.PlayerPosition);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|