示例#1
0
    //-----

    public HGenericStateFSM(string _stateName, int _stateId, GameObject _gameo, int _hLevel, bool _finalHLevel, HGenericStateFSM _fatherState, AIAgent1 _scriptAIAgent)
    {
        stateName = _stateName;

        stateId = _stateId;

        gameObject = _gameo;

        myHLevel = _hLevel;

        finalHLevel = _finalHLevel;

        if (_fatherState == null)
        {
            fatherState = _fatherState;
        }

        agentScript = _scriptAIAgent;

        myHInitialize += initializeHState;

        myHUpdate += updateHState;

        myHFinalize += finalizeHState;

        myHTransition += checkHierarchyTransitions;

        myHHandleCollisionEnter += handleHEnCollision;

        myHHandleTriggerEnter += handleHEnTrigger;
    }
    public HStateFSM(string _stateName, int _stateId, GameObject _gameo, int _hLevel, bool _finalHLevel, HStateFSM _fatherState, AIAgent1 _scriptAIAgent)
    {
        //GameObject gameo = this.gameObject;

        stateName = _stateName;

        stateId = _stateId;

        gameObject = _gameo;

        myHLevel = _hLevel;

        finalHLevel = _finalHLevel;

        if (_fatherState == null)
        {
            fatherState = _fatherState;
        }

        //TODO : ?
        //agentScript = gameObject.GetComponent<AIAgent1> ();

        agentScript = _scriptAIAgent;

        playerScript = gameObject.GetComponent <PlayerMovements> ();

        if (playerScript == null)
        {
                        #if _WARNING_DEBUG
            Debug.Log("ATTENZIONE - script PlayerMovements non trovato");
                        #endif
        }

        par = gameObject.GetComponent <AIParameters> ();

        if (par == null)
        {
                        #if _WARNING_DEBUG
            Debug.Log("ATTENZIONE - script AIParameters non trovato");
                        #endif
        }

        statusPar = par.statusParameters;

        myHInitialize += initializeHState;

        myHUpdate += updateHState;

        myHFinalize += finalizeHState;

        myHTransition += checkHierarchyTransitions;

        myHHandleCollisionEnter += handleHEnCollision;

        myHHandleTriggerEnter += handleHEnTrigger;

        //agentScript.statesMap.addState (this);
    }
示例#3
0
    public HPatrol1FSM(string _stateName, GameObject _gameo, int _hLevel, AIAgent1 _scriptAIAgent)
        : base(_stateName, 0, _gameo, _hLevel, false, null, _scriptAIAgent)
    {
        finalHLevel = false;

        if (!getStatusSpriteRenderer(ref statusSpriteRend))
        {
            Debug.Log("ATTENZIONE - spriterenderer di StatusImg non trovato");
        }

        initializePatrolParameters();
    }
    public HChase1FSM(string _stateName, GameObject _gameo, int _hLevel, AIAgent1 _scriptAIAgent)
        : base(_stateName, 0, _gameo, _hLevel, false, null, _scriptAIAgent)
    {
        finalHLevel = false;

        initializeChaseParameters();

        myFinalize += finalizeChase;

        if (!getStatusSpriteRenderer(ref statusSpriteRend))
        {
            Debug.Log("ATTENZIONE - spriterenderer di StatusImg non trovato");
        }
        //myHandleCollisionEnter
    }
示例#5
0
    public HWanderFSM(int _stateId, GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent, bool _flipControl = false)
        : base("Wander", _stateId, _gameo, _hLevel, true, _fatherState, _scriptAIAgent)
    {
        myInitialize += wanderInitialize;

        flipControl = _flipControl;

        myUpdate += wanderUpdate;

        myHandleCollisionEnter += checkFlipNeedForCollision;
        myHandleCollisionEnter += checkKillPlayerCollision;

        initializeWanderParameters();

        //wanderInitialize ();
    }
    public HCrashChaseFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base("CrashChase", _gameo, _hLevel, _scriptAIAgent)
    {
        finalHLevel   = true;
        fatherState   = _fatherState;
        myInitialize += initializeCrashChase;

        myUpdate += updateCrashChase;

        myFinalize += finalizeCrashChase;

        myHandleCollisionEnter += checkCrashWallCollision;
    }
 public HChargeChaseFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
     : base("ChargeChase", _gameo, _hLevel, _scriptAIAgent)
 {
     finalHLevel   = true;
     fatherState   = _fatherState;
     myInitialize += initializeChargeChase;
     myFinalize   += finalizeChargeChase;
 }
示例#8
0
    public HStandPatrolFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base("StandPatrol", _gameo, _hLevel, _scriptAIAgent)
    {
        finalHLevel = true;

        fatherState = _fatherState;

        myUpdate += updatePatrolStand;
    }
示例#9
0
    public HWalkPatrolFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base("WalkPatrol", _gameo, _hLevel, _scriptAIAgent)
    {
        myHandleCollisionEnter += checkFlipNeedForCollision;

        finalHLevel = true;
        fatherState = _fatherState;

        myUpdate += updatePatrolWalk;

        myInitialize += initializeWalkPatrol;

        myFinalize += finalizeWalkPatrol;
    }
    //CONSTRUCTOR----------------------------------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------------------------------------------


    public HChaseFSM(int _stateId, GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)  :
        base("Chase", _stateId, _gameo, _hLevel, true, _fatherState, _scriptAIAgent)
    {
        myInitialize += initializeChase;

        myUpdate += updateChase;

        myFinalize += finalizeChase;

        initializeChaseParameters();
    }
示例#11
0
    public HEnemyStateFSM(string _stateName, GameObject _gameo, bool _finalHLevel, HGenericStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base(_stateName, _gameo, _finalHLevel, _fatherState, _scriptAIAgent)
    {
        playerScript = gameObject.GetComponent <PlayerMovements> ();

        if (playerScript == null)
        {
                        #if _WARNING_DEBUG
            Debug.Log("ATTENZIONE - script PlayerMovements non trovato");
                        #endif
        }

        par = gameObject.GetComponent <AIParameters> ();

        if (par == null)
        {
                        #if _WARNING_DEBUG
            Debug.Log("ATTENZIONE - script AIParameters non trovato");
                        #endif
        }

        statusPar = par.statusParameters;
    }
示例#12
0
 public HFinalChildFSM(string _stateName, GameObject _gameo, int _hLevel, HStateFSM _fatherState, AIAgent1 _scriptAIAgent)
     : base(_stateName, _gameo, _hLevel, _scriptAIAgent)
 {
 }
示例#13
0
    /*
     * public GameObject []patrolPoints;
     * //verso di default dove puntare lo sguardo nel caso di un singolo punto di patrol
     * public bool DefaultVerseRight = true;
     *
     * //nuova gestione suspicious
     * bool firstCheckDone_Suspicious = false;
     * public float tSearchLenght = 2.5f;
     * bool standingSusp = false;
     * bool exitSuspicious = false;
     *
     * //variabili da resettare ad inizio stato
     * bool patrollingTowardAPoint = false;
     * Transform patrolTarget;//utile dichiararlo momentaneamente public per vedere che valore ha
     *
     * //public float DEFAULT_DUMB_SPEED = 2.0f;
     *
     * //Gestione raycast target------------------------------------
     * //public LayerMask targetLayers; dichiarata su
     * float frontalDistanceOfView = 5.0f;
     * float scale_FrontalDistanceOfView_ToBeFar = 1.5f;
     * float backDistanceOfView = 2.0f;
     *
     */

    //CONSTRUCTOR----------------------------------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------------------------------------------
    public HPatrolFSM(int _stateId, GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent, patrolSubState patrolT)
        : base("Patrol", _stateId, _gameo, _hLevel, true, _fatherState, _scriptAIAgent)
    {
        myInitialize += patrolInitialize;

        switch (patrolT)
        {
        case patrolSubState.Walk:
            myUpdate += updatePatrolWalk;
            myHandleCollisionEnter += checkFlipNeedForCollision;
            break;

        case patrolSubState.Area:
            myUpdate += updatePatrolArea;
            break;

        case patrolSubState.Stand:
            myUpdate += updatePatrolStand;
            break;
        }

        myFinalize += patrolFinalize;

        myHandleCollisionEnter += checkKillPlayerCollision;

        initializePatrolParameters();
    }
示例#14
0
    public HFleeFSM(int _stateId, GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base("Flee", _stateId, _gameo, _hLevel, true, _fatherState, _scriptAIAgent)
    {
        myInitialize += fleeInitialize;

        myUpdate += fleeUpdate;

        myHandleCollisionEnter += checkFlipNeedForCollision;
    }
示例#15
0
    public HFiglio1FSM(string _stateName, GameObject _gameo, int _hLevel, HGenericStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base(_stateName, _gameo, _hLevel, _scriptAIAgent)
    {
        finalHLevel   = true;
        fatherState   = _fatherState;
        myInitialize += initFiglio;

        myUpdate += updateFiglio;
    }
示例#16
0
 public HSuspPatrolFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
     : base("SuspPatrol", _gameo, _hLevel, _scriptAIAgent)
 {
     finalHLevel   = true;
     fatherState   = _fatherState;
     myInitialize += initializeSuspPatrol;
     myFinalize   += finalizeSuspPatrol;
     myUpdate     += updateSuspPatrol;
 }
示例#17
0
 public HPadreFSM(string _stateName, GameObject _gameo, int _hLevel, AIAgent1 _scriptAIAgent)
     : base(_stateName, 0, _gameo, _hLevel, false, null, _scriptAIAgent)
 {
     finalHLevel   = false;
     myInitialize += initPadre;
 }
    public HStunnedFSM(int _stateId, GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent, bool _killingState = true)
        : base("Stunned", _stateId, _gameo, _hLevel, true, _fatherState, _scriptAIAgent)
    {
        //killingState = _killingState;

        if (!_killingState)
        {
            myInitialize += normalStunnedInitialize;
        }
        else
        {
            myInitialize += killingStunnedInitialize;
        }

        myUpdate += stunnedUpdate;

        myFinalize += stunnedFinalize;

        initializeStunnedParameters();
    }