Added: Unity scene and assets for AI state machine demo
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace AI.FSM
|
||||
{
|
||||
public interface IFiniteStateMachine
|
||||
{
|
||||
void Update();
|
||||
void ChangeState(IState newState);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce0e46176d31468b9f1693bbf8332c5f
|
||||
timeCreated: 1793894728
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace AI.FSM
|
||||
{
|
||||
public interface IState
|
||||
{
|
||||
void Enter(IFiniteStateMachine fsm);
|
||||
void Update(IFiniteStateMachine fsm);
|
||||
void Exit(IFiniteStateMachine fsm);
|
||||
}
|
||||
|
||||
// alternative
|
||||
// public interface IStateEnter
|
||||
// {
|
||||
// void Enter(IFiniteStateMachine fsm);
|
||||
// }
|
||||
//
|
||||
// public interface IStateUpdate
|
||||
// {
|
||||
// void Update(IFiniteStateMachine fsm);
|
||||
// }
|
||||
//
|
||||
// public interface IStateExit
|
||||
// {
|
||||
// void Exit(IFiniteStateMachine fsm);
|
||||
// }
|
||||
|
||||
// alternative for state change
|
||||
// works, but not ideal
|
||||
public enum States
|
||||
{
|
||||
Idle,
|
||||
PlayerDetected,
|
||||
PlayerInRange,
|
||||
PlayerOutOfRange,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddc47971a2a34a9d8efb5321ba2b3cb8
|
||||
timeCreated: 1793894744
|
||||
Reference in New Issue
Block a user