Esempio n. 1
0
        private void MakeFSM()
        {
            mFSMSystem = new EnemyFSMSystem();

            EnemyChaseState chaseState = new EnemyChaseState(mFSMSystem, this);

            chaseState.AddTransition(EnemyTransition.CanAttack, EnemyStateID.Attack);

            EnemyAttackState attackState = new EnemyAttackState(mFSMSystem, this);

            attackState.AddTransition(EnemyTransition.LostSoldier, EnemyStateID.Chase);

            mFSMSystem.AddState(chaseState, attackState);
        }
Esempio n. 2
0
 public IEnemyState(EnemyFSMSystem fsm, ICharacter character)
 {
     mFSM       = fsm;
     mCharacter = character;
 }
Esempio n. 3
0
 public EnemyChaseState(EnemyFSMSystem fsm, ICharacter c) : base(fsm, c)
 {
     mStateID = EnemyStateID.Chase;
 }
Esempio n. 4
0
 public EnemyAttackState(EnemyFSMSystem fsm, ICharacter c) : base(fsm, c)
 {
     mStateID     = EnemyStateID.Attack;
     mAttackTimer = mAttackTime;
 }