Advertisement
Pro_Unit

MoveToTarget

Aug 31st, 2023
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. public static async UniTask MoveToTarget
  2.         (
  3.             this MAnimalAIControl control,
  4.             Transform target,
  5.             CancellationToken cancellationToken = default,
  6.             bool debug = false
  7.         )
  8.         {
  9.             $"Moving to {target.name}".When(debug, Debug.Log);
  10.             control.SetTarget(target);
  11.             await control.OnArrived.GetAsyncEventHandler(cancellationToken).OnInvokeAsync();
  12.             $"Arrived to {target.name}".When(debug, Debug.Log);
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement