Ejemplo n.º 1
0
    protected virtual void MakeFSM()
    {
        fsmSystem = new EnemySatateSystem();

        EnemyChaseState chase = new EnemyChaseState(fsmSystem, this);

        chase.AddTransition(EnemyTransition.CanAttack, EnemyStateID.Attack);
        fsmSystem.AddState(chase);

        EnemyAttackState attack = new EnemyAttackState(fsmSystem, this);

        attack.AddTransition(EnemyTransition.LostSoldier, EnemyStateID.Chase);
        fsmSystem.AddState(attack);
    }
 public AbsEnemyState(EnemySatateSystem _fsm, AbsCharacter _character)
 {
     fsm       = _fsm;
     character = _character;
 }
 public EnemyAttackState(EnemySatateSystem _fsm, AbsCharacter _character) : base(_fsm, _character)
 {
     StateID = EnemyStateID.Attack;
 }
 public EnemyChaseState(EnemySatateSystem _fsm, AbsCharacter _character) : base(_fsm, _character)
 {
     StateID = EnemyStateID.Chase;
 }