示例#1
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();
    }
 public HChargeChaseFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
     : base("ChargeChase", _gameo, _hLevel, _scriptAIAgent)
 {
     finalHLevel   = true;
     fatherState   = _fatherState;
     myInitialize += initializeChargeChase;
     myFinalize   += finalizeChargeChase;
 }
示例#3
0
    public HStandPatrolFSM(GameObject _gameo, int _hLevel, HEnemyStateFSM _fatherState, AIAgent1 _scriptAIAgent)
        : base("StandPatrol", _gameo, _hLevel, _scriptAIAgent)
    {
        finalHLevel = true;

        fatherState = _fatherState;

        myUpdate += updatePatrolStand;
    }
示例#4
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;
 }
示例#5
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;
    }
    //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();
    }
    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;
    }
示例#8
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;
    }
示例#9
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 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();
    }