void Start() { pathfinder enemyway = FindObjectOfType <pathfinder>(); var path = enemyway.getpath(); StartCoroutine(enemymovement(path)); }
// Use this for initialization void Start() { control = GameObject.FindGameObjectWithTag("Control"); Player = GameObject.FindGameObjectWithTag("Player"); nodefind = control.GetComponent <NodeFinder> (); pathfind = control.GetComponent <pathfinder> (); Seek(); }
.Select(pos => (pos, dist: GetPathDistance(pathfinder, pos, target))) .MinBy(path => path.dist)