public void GetOutdoorPath(Vector3 pos)
 {
     if (outdoorGrid == null)
     {
         outdoorGrid = GameObject.Find("OutdoorPlane").GetComponent <OutdoorGrid>();
     }
     outdoorTargetNode = outdoorGrid.NodeFromWorldPoint(pos);
     OutdoorPathRequestManager.RequestPath(transform.position, pos, OnOutdoorPathFound);
 }
 public void GetOutdoorPath(Vector3 pos, Func <bool> onArrival)
 {
     if (outdoorGrid == null)
     {
         outdoorGrid = GameObject.Find("OutdoorPlane").GetComponent <OutdoorGrid>();
     }
     OutdoorPathRequestManager.RequestPath(transform.position, pos, OnPathFound);
     OnArrival = onArrival;
 }
 void Start()
 {
     try
     {
         if (!called)
         {
             Database db = GameObject.Find("Database").GetComponent <Database>();
             instance = gameObject.GetComponent <OutdoorPathRequestManager>();
             if (db == null)
             {
                 throw new NullReferenceException();
             }
         }
         called = true;
     }
     catch (NullReferenceException)
     {
         called = false;
         // Game is loading, do nothing here
     }
 }
 void OnDestroy()
 {
     OutdoorPathRequestManager.instance = null;
 }
예제 #5
0
 void Awake()
 {
     requestManager = GetComponent <OutdoorPathRequestManager>();
     //grid = GetComponent<Grid>();
 }