private void MakeFSM() { mFSMSystem = new WolfFSMSystem(); WolfChaseState chaseState = new WolfChaseState(mFSMSystem, this); chaseState.AddTransition(WolfTransition.Reached, WolfStateID.AttackOrHold); WolfAttackOrHoldState attackOrHoldState = new WolfAttackOrHoldState(mFSMSystem, this); attackOrHoldState.AddTransition(WolfTransition.HoldSuccess, WolfStateID.Success); attackOrHoldState.AddTransition(WolfTransition.HoldFail, WolfStateID.Defeat); attackOrHoldState.AddTransition(WolfTransition.MissionComplete, WolfStateID.Leave); WolfHoldSuccessState holdSuccessState = new WolfHoldSuccessState(mFSMSystem, this); holdSuccessState.AddTransition(WolfTransition.MissionComplete, WolfStateID.Leave); WolfHoldFailState failState = new WolfHoldFailState(mFSMSystem, this); WolfLeaveState leaveState = new WolfLeaveState(mFSMSystem, this); mFSMSystem.AddState(chaseState, attackOrHoldState, holdSuccessState, failState, leaveState); }
public WolfHoldFailState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = WolfStateID.Defeat; }
public WolfAttackOrHoldState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = WolfStateID.AttackOrHold; }
public IWolfState(WolfFSMSystem fsm, ICharacter character) { mFSMSystem = fsm; mCharacter = character; }
public WolfChaseState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = WolfStateID.Chase; }
public WolfHoldSuccessState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = WolfStateID.Success; }