You've already forked taptap2024_GJ_chidouren
完成4种基础ai
This commit is contained in:
25
Assets/Scripts/Game/Component/EnemyFSM_AI/PathWalk.cs
Normal file
25
Assets/Scripts/Game/Component/EnemyFSM_AI/PathWalk.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Game.Component.FsmMonoData;
|
||||
|
||||
namespace Game.Component.EnemyFSM_AI
|
||||
{
|
||||
public class PathWalk : EnemyFSMState
|
||||
{
|
||||
private WalkPathGroup _walkPathGroup;
|
||||
|
||||
public override void OnEnter ()
|
||||
{
|
||||
this.Entity.UpdateSpeedState (false);
|
||||
this._walkPathGroup = this.Entity.GetComponent<WalkPathGroup> ();
|
||||
this._walkPathGroup.InitTarget (this.Entity.transform.position);
|
||||
this.SetAiTarget (this._walkPathGroup.CurTarget);
|
||||
}
|
||||
|
||||
public override void OnUpdate ()
|
||||
{
|
||||
if (this._walkPathGroup.CheckNextNode (this.Entity.transform.position))
|
||||
{
|
||||
this.SetAiTarget (this._walkPathGroup.CurTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user