// Update is called once per frame void Update() { switch (currentState) { case States.wanderState: agent.destination = wander.returnWanderPoints(); wander.returnWanderPoints(); break; case States.seekState: agent.destination = seek.returnTargetPos(); seek.returnTargetPos(); break; case States.fleeState: agent.destination = flee.fleeVector(); break; } switchStates(); }
// Update is called once per frame void Update() { updateState(); if (currentState == States.SeekState) { agent.destination = seek.returnTargetPos(); } else if (currentState == States.FleeState) { agent.destination = flee.returnFleeVector(); } else { gameObject.transform.LookAt(target.transform); shoot(); } }
// Update is called once per frame void Update() { updateState(); switch (currentState) { case States.SeekState: agent.destination = seek.returnTargetPos(); break; case States.StartoverState: agent.destination = home.position; break; case States.FleeState: agent.destination = flee.returnFleeVector(); break; } Debug.DrawLine(agent.destination, transform.position, Color.red); }
// Update is called once per frame void Update() { switch (currentState) { case States.WanderState: agent.destination = wander.returnWanderPoints(); break; case States.FleeState: agent.destination = flee.returnFleeVector(); break; case States.SeekState: agent.destination = seek.returnTargetPos(); break; case States.StartoverState: Debug.Log("stuck in startover state"); break; } switchStates(); }