예제 #1
0
    public void setDefaultTransitions(HStunnedFSM stunState, HChase1FSM chaseState)
    {
        addTransition(P2ScheckStunned, stunState);

        addTransition(P2CcheckChaseTarget, chaseState);

        addTransition(Any2KScheckInstantKill, stunState);
    }
예제 #2
0
    public void setDefaultTransitions(HStunnedFSM stunState, HPatrolFSM patrolState)
    {
        //addTransition (C2ScheckStunned, "Stunned");

        addTransition(C2ScheckStunned, stunState);
        //addTransition (C2PlostTarget, "Patrol");
        addTransition(C2PlostTarget, patrolState);

        //addTransition( stun)
    }
예제 #3
0
    public void setDefaultTransitions(HStunnedFSM stunState, HChaseFSM chaseState)
    {
        //addTransition (P2FcheckDanger, "Flee");

        //addTransition (P2CcheckChaseTarget, "Chase");

        //addTransition (P2ScheckStunned, "Stunned");
        addTransition(P2ScheckStunned, stunState);

        //addTransition (P2CcheckChaseTarget, "Chase");
        addTransition(P2CcheckChaseTarget, chaseState);
    }
예제 #4
0
    protected override void initializeHStates()
    {
        aiParam = GetComponent <AIParameters> ();

        HWanderFSM hw = new HWanderFSM(0, this.gameObject, 0, null, this, flipControl);

        HStunnedFSM hs = new HStunnedFSM(1, this.gameObject, 0, null, this);

        addState(hw);

        addState(hs);

        //-------

        setActiveState(hw);

        hw.setDefaultTransitions(hs);

        hs.setDefaultTransitions(hw);
    }
예제 #5
0
    protected override void initializeHStates()
    {
        //Time.timeScale = 0.3f;

        HPatrolFSM hp = new HPatrolFSM(0, this.gameObject, 0, null, this, patrolType);

        HStunnedFSM hs = new HStunnedFSM(1, this.gameObject, 0, null, this, false);
        //(string _stateName, GameObject _gameo, int _hLevel, AIAgent1 _scriptAIAgent)
        HChase1FSM hc = new HChase1FSM("Chase", this.gameObject, 0, this);

        HChargeChaseFSM hcc1 = new HChargeChaseFSM(this.gameObject, 1, hc, this);
        HCrashChaseFSM  hcc2 = new HCrashChaseFSM(this.gameObject, 1, hc, this);

        addState(hp);

        addState(hs);

        addState(hc);

        hc.setDefaultStates(hcc1, hcc2);
        //hc.addState (hcc1);
        //hc.addState (hcc2);

        //hpadre.addState (hfiglio1);
        //hpadre.addState (hfiglio2);

        //------

        setActiveState(hp);

        hp.setDefaultTransitions(hs, hc);

        hs.setDefaultTransitions(hp);

        hc.setDefaultInitialize();
        hc.setDefaultTransitions(hs, hp);
        hc.setDefaultCollision();

        hcc1.setDefaultTransitions(hcc2);
        hcc2.setDefaultTransitions(hs, null);
    }
예제 #6
0
    //initializeHStates ();
    //setStartState ();
    //initializeConditions ();



    protected override void initializeHStates()
    {
        HPatrolFSM hp = new HPatrolFSM(0, this.gameObject, 0, null, this, HPatrolFSM.patrolSubState.Walk);

        HStunnedFSM hs = new HStunnedFSM(1, this.gameObject, 0, null, this, false);

        HChaseFSM hc = new HChaseFSM(2, this.gameObject, 0, null, this);

        addState(hp);

        addState(hs);

        addState(hc);

        //------

        setActiveState(hp);

        hp.setDefaultTransitions(hs, hc);

        hs.setDefaultTransitions(hp);

        hc.setDefaultTransitions(hs, hp);
    }
예제 #7
0
    protected override void initializeHStates()
    {
        //Time.timeScale = 0.3f;

        //HPatrolFSM hp = new HPatrolFSM (0, this.gameObject, 0, null, this, patrolType);

        aiParam = GetComponent <AIParameters> ();

        HPatrol1FSM hP = new HPatrol1FSM("Patrol", this.gameObject, 0, this);

        HSuspPatrolFSM hps = new HSuspPatrolFSM(this.gameObject, 1, hP, this);
        HWalkPatrolFSM hpw = new HWalkPatrolFSM(this.gameObject, 1, hP, this);
        HPatrol1FSM    defaultChildPatrol = null;

        switch (patrolType)
        {
        case PatrolType.Walk:
            defaultChildPatrol = hpw;
            break;

        case PatrolType.Area:
            HAreaPatrolFSM hpa = new HAreaPatrolFSM(this.gameObject, 1, hP, this);
            defaultChildPatrol = hpa;
            break;

        case PatrolType.Stand:
            HStandPatrolFSM hpst = new HStandPatrolFSM(this.gameObject, 1, hP, this);
            defaultChildPatrol = hpst;
            break;

        default:
            break;
        }

        HStunnedFSM hs = new HStunnedFSM(1, this.gameObject, 0, null, this, false);

        HChase1FSM      hc   = new HChase1FSM("Chase", this.gameObject, 0, this);
        HChargeChaseFSM hcc1 = new HChargeChaseFSM(this.gameObject, 1, hc, this);
        HCrashChaseFSM  hcc2 = new HCrashChaseFSM(this.gameObject, 1, hc, this);

        addState(hP);
        addState(hs);
        addState(hc);

        //patrol

        hP.setDefaultStates(hps, defaultChildPatrol, hpw);
        hP.setDefaultTransitions(hs, hc);
        hP.setDefaultDelegates();

        switch (patrolType)
        {
        case PatrolType.Walk:

            break;

        case PatrolType.Area:
            ((HAreaPatrolFSM)defaultChildPatrol).setDefaultTransitions(hpw);
            break;

        case PatrolType.Stand:
            ((HStandPatrolFSM)defaultChildPatrol).setDefaultTransitions(hpw);
            break;

        default:
            break;
        }

        hps.setDefaultTransitions(defaultChildPatrol);

        setActiveState(hP);

        //chase

        //TODO: da restringere ad una chiamata : - states - delegates - transitions - collision
        hc.setDefaultStates(hcc1, hcc2);
        hc.setDefaultInitialize();
        hc.setDefaultTransitions(hs, hP);
        hc.setDefaultCollision();

        hcc1.setDefaultTransitions(hcc2);
        hcc2.setDefaultTransitions(hs, hP);

        //stun

        hs.setDefaultTransitions(hP);
    }
예제 #8
0
 public void setDefaultTransitions(HStunnedFSM stunState)
 {
     //addTransition (W2ScheckStunned, "Stunned");
     addTransition(W2ScheckStunned, stunState);
     addTransition(Any2KScheckInstantKill, stunState);
 }
예제 #9
0
    public void setDefaultTransitions(HStunnedFSM hstunn, HPatrol1FSM hpatrol)
    {
        addTransition(CC2ScheckWallStun, hstunn);

        addTransition(CC2PcheckNotInFrontTarget, hpatrol);
    }
예제 #10
0
 public void setDefaultTransitions(HStunnedFSM hstun, HPatrol1FSM hpatrol)
 {
     addTransition(C2ScheckStun, hstun);
     addTransition(C2PlostTargetNull, hpatrol);
     addTransition(Any2KScheckInstantKill, hstun);
 }
예제 #11
0
 public void setDefaultTransitions(HStunnedFSM stunState)
 {
     //addTransition (F2ScheckStunned, "Stunned");
     addTransition(F2ScheckStunned, stunState);
 }