private void Start() { target = GameObject.FindGameObjectWithTag("Player"); debug = WaypointGraph.Get("debug"); origin = transform.position; Path = debug.QueryPath(transform.position, target.transform.position); }
private void OnGUI() { if (GUI.Button(new Rect(0, 0, 100, 40), "Restart")) { transform.position = origin; Path = debug.QueryPath(transform.position, target.transform.position); pathIndex = 0; } }