public void LoadModule() { IForEachRayOriginMethods.forEachRayOrigin = IterateRayOrigins; IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; INodeToRayMethods.requestRayOriginFromNode = RequestRayOriginFromNode; var moduleLoaderCore = ModuleLoaderCore.instance; m_ToolModule = moduleLoaderCore.GetModule <EditorXRToolModule>(); m_WorkspaceModule = moduleLoaderCore.GetModule <WorkspaceModule>(); m_MenuModule = moduleLoaderCore.GetModule <EditorXRMenuModule>(); m_MiniWorldModule = moduleLoaderCore.GetModule <EditorXRMiniWorldModule>(); m_DirectSelectionModule = moduleLoaderCore.GetModule <EditorXRDirectSelectionModule>(); m_SerializedPreferences = moduleLoaderCore.GetModule <SerializedPreferencesModule>(); m_IntersectionModule = moduleLoaderCore.GetModule <IntersectionModule>(); var selectionModule = moduleLoaderCore.GetModule <SelectionModule>(); if (selectionModule != null) { ignoreList = selectionModule.standardIgnoreList; } m_ModuleParent = moduleLoaderCore.GetModuleParent().transform; }
void SaveData() { var preferences = SerializedPreferencesModule.DeserializePreferences(Core.EditorVR.serializedPreferences); if (preferences == null) { return; } var items = preferences.items; foreach (var kvp in m_SerializedFeedback) { items[kvp.Key].payload = JsonUtility.ToJson(kvp.Value); } Core.EditorVR.serializedPreferences = JsonUtility.ToJson(preferences); }
static void ClearData() { var preferences = SerializedPreferencesModule.DeserializePreferences(Core.EditorVR.serializedPreferences); if (preferences == null) { return; } foreach (var kvp in new Dictionary <Type, SerializedPreferencesModule.SerializedPreferenceItem>(preferences.items)) { var type = kvp.Key; if (typeof(TwoHandedProxyBase).IsAssignableFrom(type)) { preferences.Remove(type); } } Core.EditorVR.serializedPreferences = JsonUtility.ToJson(preferences); }
void Refresh() { m_SerializedFeedback.Clear(); var preferences = SerializedPreferencesModule.DeserializePreferences(Core.EditorVR.serializedPreferences); if (preferences == null) { return; } foreach (var kvp in preferences.items) { var type = kvp.Key; if (typeof(TwoHandedProxyBase).IsAssignableFrom(type)) { var item = kvp.Value; Type payloadType = null; foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { payloadType = assembly.GetType(item.payloadType); if (payloadType != null) { break; } } if (payloadType == null) { continue; } var payload = (SerializedProxyFeedback)JsonUtility.FromJson(item.payload, payloadType); m_SerializedFeedback[kvp.Key] = payload; } } }