public static void RequestPath(AgentNPC agent, Vector3 pathEnd, Faction faction, Action <Vector3[], bool> callback) { PathRequest newRequest = new PathRequest(agent, pathEnd, faction, callback); Debug.Assert(Map.NodeFromPosition(pathEnd).isWalkable()); if (instance.repetitions.ContainsKey(agent)) { instance.repetitions[agent] += 1; } else { instance.repetitions[agent] = 1; } instance.requestQueue.Enqueue(newRequest); instance.ProcessNext(); }