///<summary>Creates a Request to Mover MonoBehavior object to a destination.</summary> ///<param name="destination">The desintation to move to</param> ///<param name="moveParent">The GameObject to parent to after the move is completed</param> ///<param name="callback">The callback to call after the function is done</param> ///<param name="speed">The speed in which to move (multiplied by TimeDelta)</param> public MoveRequest(Vector3 destination, GameObject moveParent, MoveCompleteCallback callback, int speed = 12) { _destination = destination; _moveParent = moveParent; _callback = callback; _speed = speed; }
public void GoToPoint(Vector3 point, MoveCompleteCallback moveCompleteCallback = null) { destination = new Vector3(point.x, 0, point.z); navMeshAgent.destination = destination; moveComplete = moveCompleteCallback; }