static void SaveEditorSettings() { TBEditorHelper.CheckoutAndSaveJSONFile("TButtEditorServices.json", selectedServices, TBDataManager.PathType.ProjectFolder, true); if (selectedServices.oculus) { TBEditorServiceDefines.SetTButtService(VRService.Oculus); } else if (selectedServices.steam) { TBEditorServiceDefines.SetTButtService(VRService.Steam); } else if (selectedServices.psn) { TBEditorServiceDefines.SetTButtService(VRService.PSN); } else if (selectedServices.xbox) { TBEditorServiceDefines.SetTButtService(VRService.XboxLive); } else { TBEditorServiceDefines.SetTButtService(VRService.None); } }
static void SaveSettings() { // Save global settings. if (!savedControlSettings.Equals(controlSettings)) { TBEditorHelper.CheckoutAndSaveJSONFile(settingsPath + TBSettings.settingsFolder + TBSettings.controlSettingsFileName + ".json", controlSettings, TBDataManager.PathType.ProjectFolder); //TBDataManager.SerializeObjectToFile(controlSettings, settingsPath + TBSettings.settingsFolder + TBSettings.controlSettingsFileName + ".json", TBDataManager.PathType.ProjectFolder); } SaveAllButtonMaps(); TBLogging.LogMessage("All input settings saved.", null, messageEnd); }
/// <summary> /// Saves button settings to JSON. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="maps"></param> public static void SaveButtonMaps <T>(ButtonMapGroup <TBInput.ButtonDef <T> > maps) { TBLogging.LogMessage("Writing maps for " + maps.controllerName + " to " + settingsPath + TBSettings.settingsFolder + maps.fileName + ".json...", null, messageEnd); TBInput.SerializedButtonDef[] controllerDef = new TBInput.SerializedButtonDef[maps.defs.Count]; for (int i = 0; i < maps.defs.Count; i++) { controllerDef[i] = new TBInput.SerializedButtonDef(); controllerDef[i].virtualButtons = maps.defs[i].virtualButtons; } //string json = TBDataManager.ToJson<TBInput.SerializedButtonDef>(controllerDef); //TBDataManager.SerializeObjectToFile(TBDataManager.ToJsonWrapper<TBInput.SerializedButtonDef>(controllerDef), settingsPath + TBSettings.settingsFolder + maps.fileName + ".json", TBDataManager.PathType.ResourcesFolder); TBEditorHelper.CheckoutAndSaveJSONFile(settingsPath + TBSettings.settingsFolder + maps.fileName + ".json", TBDataManager.ToJsonWrapper <TBInput.SerializedButtonDef>(controllerDef), TBDataManager.PathType.ResourcesFolder); TBLogging.LogMessage("Finished writing maps for " + maps.controllerName + ". ", null, messageEnd); }
public virtual void SaveSettingsFile(string filename, object obj) { TBLogging.LogMessage("Saving " + filename + "..."); TBEditorHelper.CheckoutAndSaveJSONFile(TBEditorDefines.settingsPath + TBSettings.settingsFolder + filename + ".json", obj, TBDataManager.PathType.ResourcesFolder); }
static void SaveGlobalSettings() { TBEditorHelper.CheckoutAndSaveJSONFile(TBEditorDefines.settingsPath + TBSettings.settingsFolder + TBSettings.cameraSettingsFilename + ".json", camSettings, TBDataManager.PathType.ResourcesFolder); }
static void SaveEditorSettings() { TBEditorHelper.CheckoutAndSaveJSONFile("TButtEditorSDKs.json", editorSDKs, TBDataManager.PathType.ProjectFolder, true); SetScriptingDefines(editorSDKs); }