IEnumerator UpdateTarget() { while (this.target) { RequestPathManager.RequestPath(transform.position, target.position, this.OnPathFound); yield return(new WaitForSeconds(1)); } yield return(null); }
void FixedUpdate() { if (Input.GetKeyDown("r")) { this.transform.position = new Vector3(7, 0, 18); targetIndex = 0; StopCoroutine("FollowPath"); RequestPathManager.RequestPath(transform.position, target.position, this.OnPathFound); } }
private void Awake() { instance = this; pathfinding = GetComponent <Pathfinding>(); }
void Awake() { instance = this; pathFinding = this.GetComponent <PathFinding>(); }
private void Awake() { grid = GetComponent <Grid>(); this.requestManager = GetComponent <RequestPathManager>(); }