Exemplo n.º 1
0
    private void MakeFSM()
    {
        ActorAttackState attackState = new ActorAttackState(2.0f);
        ActorMoveState moveState = new ActorMoveState(1.0f);

        ActorSkillState skillState = new ActorSkillState(0.1f);

        attackState.AddTransition(Transition.TS_FIND_TARGET, StateID.STS_MOVE);
        attackState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL);

        moveState.AddTransition(Transition.TS_ATTACK, StateID.STS_ATTACK);
        moveState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL);

        fsm = new FSMMgr();
        fsm.AddState(moveState);
        fsm.AddState(attackState);
        fsm.AddState(skillState);
    }
Exemplo n.º 2
0
    private void MakeFSM()
    {
        ActorAttackState attackState = new ActorAttackState(2.0f);
        ActorMoveState   moveState   = new ActorMoveState(1.0f);

        ActorSkillState skillState = new ActorSkillState(0.1f);

        attackState.AddTransition(Transition.TS_FIND_TARGET, StateID.STS_MOVE);
        attackState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL);

        moveState.AddTransition(Transition.TS_ATTACK, StateID.STS_ATTACK);
        moveState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL);

        fsm = new FSMMgr();
        fsm.AddState(moveState);
        fsm.AddState(attackState);
        fsm.AddState(skillState);
    }