Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     agent     = GetComponent <NavMeshAgent>();
     player    = GameObject.FindGameObjectWithTag("Player");
     waitTimer = Random.Range(3, 5);
     state     = SchimStates.Idle;
 }
Exemplo n.º 2
0
    private void ExecuteState()
    {
        if (CheckPlayerInRange(runRange))
        {
            state = SchimStates.Run;
        }

        switch (state)
        {
        case SchimStates.Run:
            RunState();
            break;

        case SchimStates.Idle:
            IdleState();
            break;
        }
    }
Exemplo n.º 3
0
 public void SwitchState(SchimStates newState)
 {
     state = newState;
 }