// Update is called once per frame void Update() { AIHelper.InputParameters inputData = new AIHelper.InputParameters(gameObject.transform, targetObject.transform, Time.deltaTime, maxSpeed); AIHelper.MovementResult movementResult = new AIHelper.MovementResult(); switch (activeMovementBehavior) { case AIHelper.MovementBehaviors.FleeKinematic: AIHelper.FleeKinematic(inputData, ref movementResult); break; case AIHelper.MovementBehaviors.SeekKinematic: AIHelper.SeekKinematic(inputData, ref movementResult); break; case AIHelper.MovementBehaviors.WanderKinematic: AIHelper.WanderKinematic(inputData, ref movementResult); break; default: //AIHelpers.SeekKinematic(inputData, ref movementResult); movementResult.newPosition = transform.position; break; } gameObject.transform.position = movementResult.newPosition; transform.LookAt(targetObject.transform); }