Pro_Unit

CheckMissingWaypoints

Oct 15th, 2020
609
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3. using MalbersAnimations.Controller;
  4. public class CheckMissingWaypoints : MonoBehaviour
  5. {
  6.     [ContextMenu("Check")]
  7.     void Check()
  8.     {
  9.         var waypoints = GameObject.FindObjectsOfType<MWayPoint>();
  10.  
  11.         foreach (var waypoint in waypoints)
  12.         {
  13.             foreach (var target in waypoint.NextTargets)
  14.             {
  15.                 if (target == null)
  16.                 {
  17.                     Debug.Log($"waypoint : {waypoint}", waypoint);
  18.                     break;
  19.                 }
  20.             }
  21.         }
  22.     }
  23. }
  24.  
RAW Paste Data