コード例 #1
0
ファイル: Actor.cs プロジェクト: rouchen/UnityDemo
    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);
    }
コード例 #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);
    }