public void UpdatePickups(PathProber path_prober, Worker worker) { Navigator component = worker.GetComponent <Navigator>(); updatePickupsWorkItems.Reset(null); foreach (KeyValuePair <Tag, FetchablesByPrefabId> prefabIdToFetchable in prefabIdToFetchables) { FetchablesByPrefabId value = prefabIdToFetchable.Value; value.UpdateOffsetTables(); updatePickupsWorkItems.Add(new UpdatePickupWorkItem { fetchablesByPrefabId = value, pathProber = path_prober, navigator = component, worker = worker.gameObject }); } OffsetTracker.isExecutingWithinJob = true; GlobalJobManager.Run(updatePickupsWorkItems); OffsetTracker.isExecutingWithinJob = false; pickups.Clear(); foreach (KeyValuePair <Tag, FetchablesByPrefabId> prefabIdToFetchable2 in prefabIdToFetchables) { pickups.AddRange(prefabIdToFetchable2.Value.finalPickups); } pickups.Sort(ComparerNoPriority); }
public HandleVector <int> .Handle Add(Pickupable pickupable) { Tag tag = pickupable.PrefabID(); FetchablesByPrefabId value = null; if (!prefabIdToFetchables.TryGetValue(tag, out value)) { value = new FetchablesByPrefabId(tag); prefabIdToFetchables[tag] = value; } return(value.AddPickupable(pickupable)); }