Exemple #1
0
 void Update()
 {
     // if there is a current state, use the Methods within
     if (currentState != null)
     {
         currentState.Act();
     }
 }
 void Update()
 {
     currentState.CheckTransitions();
     currentState.Act();
     healthText.text = health.ToString();
     healthText.transform.LookAt(GameObject.FindGameObjectWithTag("Player").transform);
     healthText.transform.Rotate(0, 180, 0);
 }
Exemple #3
0
 void Update()
 {
     // als we een state hebben: uitvoeren die hap
     if (currentState != null)
     {
         currentState.Reason();
         currentState.Act();
     }
 }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        //This is where you run the 2 functions in each state

        currentState.CheckTransitions();
        currentState.Act();

        // print(currentState);
    }
Exemple #5
0
    void Update()
    {
        if (_currentState == null)
        {
            return;
        }

        _currentState.Reason();
        _currentState.Act();
    }
Exemple #6
0
    private void Update()
    {
        StateID id = currentState.Decide();

        if (id != StateID.NULL)
        {
            PerformTransition(id);
        }
        currentState.Act();
    }
Exemple #7
0
    void Update()
    {
        // als we een state hebben: uitvoeren die hap
        if (_currentState == null)
        {
            return;
        }

        _currentState.Reason();
        _currentState.Act();
    }
Exemple #8
0
    void Update()
    {
        currentState.CheckTransitions();
        currentState.Act();

        if (InAttackRange("Player") && (!hero.invisible || !hero.Emma.activeInHierarchy))
        {
            enemyAnimator.SetTrigger("Attack");
        }

        checkHealth();
    }
Exemple #9
0
 public void UpdateFSM()
 {
     if (isActive)
     {
         currentState.Act(gameObject);    // cumple las acciones del estado
         currentState.Reason(gameObject); // verifica si alguna transicion se activa
     }
     else
     {
         Debug.Log("La maquina de estados no esta activa");
     }
 }
Exemple #10
0
    public void UpdateState()
    {
        if (currentState.Reason())
        {
            currentState.Act();
        }
        else
        {
            try { currentState = States[currentState.Leave()]; }
            catch { currentState = States[defaultState]; }

            currentState.Enter(obj, anim);
        }
    }
Exemple #11
0
 void Update()
 {
     currentState.CheckTransitions();
     currentState.Act();
 }
 void FixedUpdate()
 {
     //Check for transitions and act on the current state
     currentState.CheckTransitions();
     currentState.Act();
 }
Exemple #13
0
 public override Move Act()
 {
     Enter(_state.Update());
     return(_state.Act());
 }
Exemple #14
0
 void Update()
 {
     currentState.Reason();
     currentState.Act();
 }
 public void Act(Player player)
 {
     currentState.Act(player);
 }