示例#1
0
    private void MakeFSM()
    {
        mFSMSys = new SoldierFSMSys();

        SoldierChaseState chaseState = new SoldierChaseState(mFSMSys, this);

        chaseState.AddTransition(SoldierTransition.CanAttack, SoldierStateID.Attack);

        SoldierAttackState attackState = new SoldierAttackState(mFSMSys, this);

        attackState.AddTransition(SoldierTransition.LostSoldier, SoldierStateID.Chase);

        mFSMSys.AddState(chaseState, attackState);
    }
示例#2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="fsm"></param>
 /// <param name="character"></param>
 public ISoldierState(SoldierFSMSys fsm, ICharacter character)
 {
     mFSM       = fsm;
     mCharacter = character;
 }
示例#3
0
 public SoldierAttackState(SoldierFSMSys fsm, ICharacter c) : base(fsm, c)
 {
     mStateID     = SoldierStateID.Attack;
     mAttackTimer = mAttackTime;
 }
示例#4
0
 public SoldierChaseState(SoldierFSMSys fsm, ICharacter c) : base(fsm, c)
 {
     mStateID = SoldierStateID.Chase;
 }