void OnEnable() { if (mapNonPublic && mapStatic && !mapOnlyMembersMarkedWithTweach) { Debug.LogWarning("Mapping all non public static fields can be dangerous!"); } gameObjectReferences = GetReferenceMapperWithSettings().GetRootGameObjectReferences(logMapTime); if (logMap) { Debug.Log(Utilities.GetDebugString(gameObjectReferences)); } uiInstantiator = GetUiInstantiatorWithSettings(); //For search function uiInstantiator.FillHierarchy(gameObjectReferences); }
void OnDisable() { gameObjectReferences = null; //Let GC collect the static list uiInstantiator = null; //and the uiInstatiator runOnExit?.Invoke(); }