Exemplo n.º 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;
    }
Exemplo n.º 2
0
    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);
    }