// all providers in here setup their own static FI, as does the database itself void IModule.LoadModule() { // pre-allocate collections used in tracking state m_MemoryOptions = MARSMemoryOptions.instance; Pools.QueryDataDirtyStates.PreAllocate(m_MemoryOptions.DataDirtyStatesPreAllocationCount); Pools.DataIdHashSets.PreAllocate(m_MemoryOptions.MatchIdHashSetPreAllocationCount); planeData = new MARSTrackableDataProvider <MRPlane>(); referencePointData = new MARSTrackableDataProvider <MRReferencePoint>(); faceData = new MARSTrackableDataProvider <IMRFace>(); bodyData = new MARSTrackableDataProvider <IMarsBody>(); markerData = new MARSTrackableDataProvider <MRMarker>(); synthesizedObjectData = new MARSDataProvider <SynthesizedObject>(); Action <int> setDirtyIfNeeded = SetDirtyIfNeeded; InitializeTraitProviders(setDirtyIfNeeded); AddRequirementUpdateMethods(this); IUsesDatabaseQueryingMethods.MarkDataUsedForUpdates = MarkDataUsedForUpdates; IUsesDatabaseQueryingMethods.UnmarkDataUsedForUpdates = UnmarkDataUsedForUpdates; IUsesDatabaseQueryingMethods.QueryDataDirty = QueryDataDirty; IUsesDatabaseQueryingMethods.TryUpdateQueryMatchData = TryUpdateQueryMatchData; IUsesDatabaseQueryingMethods.MarkSetDataUsedForUpdates = MarkSetDataUsedForUpdates; IUsesDatabaseQueryingMethods.UnmarkSetDataUsedForUpdates = UnmarkSetDataUsedForUpdates; IUsesDatabaseQueryingMethods.UnmarkPartialSetDataUsedForUpdates = UnmarkPartialSetDataUsedForUpdates; IUsesDatabaseQueryingMethods.IsSetQueryDataDirty = IsSetQueryDataDirty; IUsesDatabaseQueryingMethods.TryUpdateSetQueryMatchData = TryUpdateSetQueryMatchData; }
static void DrawDataCollection <T>(string label, MARSDataProvider <T> provider) { EditorGUILayout.Separator(); EditorGUILayout.LabelField(label, EditorStyles.boldLabel); foreach (var traitsKVP in provider.dictionary) { EditorGUILayout.LabelField(String.Format("ID:{0}", traitsKVP.Key)); EditorGUILayout.HelpBox(String.Format("{0}", traitsKVP.Value), MessageType.None); } }