Traveller/scripts/stateMachine/PatrolStateMachine.cs
Cold-Mint 7812d9c570
Remove useless dependencies and add logic for AI to find weapons.
移除无用依赖,加入AI查找武器的逻辑。
2024-07-17 22:54:42 +08:00

30 lines
967 B
C#

using ColdMint.scripts.stateMachine.StateProcessor;
namespace ColdMint.scripts.stateMachine;
/// <summary>
/// <para>State machine for patrollers</para>
/// <para>适用于巡逻者的状态机</para>
/// </summary>
public class PatrolStateMachine : StateMachineTemplate
{
protected override void OnStart(StateContext context)
{
var patrolStateProcessor = new PatrolStateProcessor
{
Points =
[
new Godot.Vector2(100, 0),
new Godot.Vector2(-100, 0),
new Godot.Vector2(50, 0),
new Godot.Vector2(-50, 0),
new Godot.Vector2(0, 0)
]
};
RegisterProcessor(patrolStateProcessor);
var chaseStateProcessor = new ChaseStateProcessor();
RegisterProcessor(chaseStateProcessor);
var lookForWeaponProcessor = new LookForWeaponProcessor();
RegisterProcessor(lookForWeaponProcessor);
}
}