Ejemplo n.º 1
0
 public void OnPathFound(Vector3[] newPath, bool pathSuccessful)
 {
     if (pathSuccessful)
     {
         path        = newPath;
         targetIndex = 0;
         StopCoroutine("FollowPath");
         StartCoroutine("FollowPath");
     }
     else
     {
         Debug.Log("no path found");
         RequestPathManager.ClearQueue();
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     instance    = this;
     pathfinding = GetComponent <FindPath>();
 }
Ejemplo n.º 3
0
 private void Start()
 {
     RequestPathManager.RequestPath(transform.position, target.position, OnPathFound);
 }
Ejemplo n.º 4
0
 private void Awake()
 {
     requestManager = GetComponent <RequestPathManager>();
     grid           = GetComponent <Grid3D>();
 }