private IEnumerator SimulateTaskWait(Task task) { busy = true; // TODO: Should use tile health here. yield return(new WaitForSeconds(Random.Range(.5f, 1f))); busy = false; Debug.Log("Obtained:" + task.resourceType); queue.DestroyTaskById(currentTask.id); currentTask = null; agent.ResetPath(); // Temporary: A horrible quick and dirty way to force a re-check of // previous tasks. invalidTasks.Clear(); }