private void MakeFSM() { mFSMSystem = new EnemyFSMSystem(); EnemyStateChase enemyStateChase = new EnemyStateChase(mFSMSystem, this); enemyStateChase.AddTransition(EnemyTransition.CanAttack, EnemyStateID.Attack); EnemyStateAttack enemyStateAttack = new EnemyStateAttack(mFSMSystem, this); enemyStateAttack.AddTransition(EnemyTransition.LostSoldier, EnemyStateID.Chase); mFSMSystem.AddState(enemyStateAttack, enemyStateChase); }
public EnemyStateChase(EnemyFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = EnemyStateID.Chase; }
public IEnemyState(EnemyFSMSystem fsm, ICharacter character) { mFSM = fsm; mCharacter = character; }
public EnemyStateAttack(EnemyFSMSystem fsm, ICharacter character) : base(fsm, character) { mStateID = EnemyStateID.Attack; mAttackTimer = mAttackTime; }