Esempio n. 1
0
    private void MakeFSM()
    {
        m_FSMSystem = new SoldierFSMSystem();
        SoldierIdleState idleState = new SoldierIdleState(m_FSMSystem, this);

        idleState.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);

        SoldierChaseState chaseState = new SoldierChaseState(m_FSMSystem, this);

        chaseState.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        chaseState.AddTransition(SoldierTransition.CanAttack, SoldierStateID.Attack);

        SoldierAttackState attackState = new SoldierAttackState(m_FSMSystem, this);

        attackState.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        attackState.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);

        m_FSMSystem.AddState(idleState, chaseState, attackState);
    }
Esempio n. 2
0
    private void MakeFsm()
    {
        Fsm = new SoldierFSMSystem();

        SoldierIdleState idle = new SoldierIdleState(Fsm, this);

        idle.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);

        SoldierChaseState chase = new SoldierChaseState(Fsm, this);

        chase.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        chase.AddTransition(SoldierTransition.CanAttack, SoldierStateID.Attack);

        SoldierAttackState attack = new SoldierAttackState(Fsm, this);

        attack.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        attack.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);

        Fsm.AddState(idle, chase, attack);
    }
    protected virtual void MakeFSM()
    {
        fsmSystem = new SoldierSatateSystem();

        SoldierIdleState idle = new SoldierIdleState(fsmSystem, this);

        idle.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);


        SoldierAttackState attack = new SoldierAttackState(fsmSystem, this);

        attack.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        attack.AddTransition(SoldierTransition.SeeEnemy, SoldierStateID.Chase);

        SoldierChaseState chase = new SoldierChaseState(fsmSystem, this);

        chase.AddTransition(SoldierTransition.NoEnemy, SoldierStateID.Idle);
        chase.AddTransition(SoldierTransition.CanAttack, SoldierStateID.Attack);

        fsmSystem.AddStateRange(idle, attack, chase);
    }
Esempio n. 4
0
    private void MakeFSM()
    {
        mFSMSys = new SoldierFSMSys();

        SoldierChaseState chaseState = new SoldierChaseState(mFSMSys, this);

        chaseState.AddTransition(SoldierTransition.CanAttack, SoldierStateID.Attack);

        SoldierAttackState attackState = new SoldierAttackState(mFSMSys, this);

        attackState.AddTransition(SoldierTransition.LostSoldier, SoldierStateID.Chase);

        mFSMSys.AddState(chaseState, attackState);
    }