void LoadSettings() { string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsWindow); if (File.Exists(filePath)) { string windowSettingsData = File.ReadAllText(filePath); int value = 0; if (int.TryParse(windowSettingsData, out value)) { m_SelectedMode = (TerrainManagerMode)value; } } }
public void SaveSettings() { if (m_SelectedPreset != null) { m_Settings.PresetPath = AssetDatabase.GetAssetPath(m_SelectedPreset); } else { m_Settings.PresetPath = string.Empty; } string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsCreate); string createSettingsData = JsonUtility.ToJson(m_Settings); File.WriteAllText(filePath, createSettingsData); }
public void SaveSettings() { if (m_SelectedPreset != null) { m_PresetPath = AssetDatabase.GetAssetPath(m_SelectedPreset); } else { m_PresetPath = string.Empty; } string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsVisualization); string settingsData = JsonUtility.ToJson(m_Settings); File.WriteAllText(filePath, settingsData); SceneView.RepaintAll(); }
public void LoadSettings() { string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsCreate); if (File.Exists(filePath)) { string createSettingsData = File.ReadAllText(filePath); JsonUtility.FromJsonOverwrite(createSettingsData, m_Settings); } if (m_Settings.PresetPath == string.Empty) { m_SelectedPreset = null; } else { m_SelectedPreset = AssetDatabase.LoadAssetAtPath(m_Settings.PresetPath, typeof(TerrainCreationSettings)) as TerrainCreationSettings; } }
public void SaveSettings() { if (m_SelectedPreset != null) { m_Settings.PresetPath = AssetDatabase.GetAssetPath(m_SelectedPreset); } else { m_Settings.PresetPath = string.Empty; } string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsSettings); string settingsData = JsonUtility.ToJson(m_Settings); File.WriteAllText(filePath, settingsData); RevertMaterial(); m_selectedMode = VISUALIZERMODE.None; SceneView.RepaintAll(); }
public void SaveSettings() { if (m_SelectedPreset != null) { m_PresetPath = AssetDatabase.GetAssetPath(m_SelectedPreset); } else { m_PresetPath = string.Empty; } string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsVisualization); string settingsData = JsonUtility.ToJson(m_Settings); File.WriteAllText(filePath, settingsData); SceneView.RepaintAll(); EditorSceneManager.sceneSaving -= OnSceneSaving; EditorSceneManager.sceneSaved -= OnSceneSaved; EditorSceneManager.sceneOpened -= OnSceneOpened; EditorApplication.playModeStateChanged -= PlayModeChanged; Undo.undoRedoPerformed -= OnUndo; }
public void LoadSettings() { string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsVisualization); if (File.Exists(filePath)) { string settingsData = File.ReadAllText(filePath); JsonUtility.FromJsonOverwrite(settingsData, m_Settings); } if (m_PresetPath == string.Empty) { m_SelectedPreset = null; } else { m_SelectedPreset = AssetDatabase.LoadAssetAtPath(m_PresetPath, typeof(TerrainVisualizationSettings)) as TerrainVisualizationSettings; } EditorSceneManager.sceneSaving += OnSceneSaving; EditorSceneManager.sceneSaved += OnSceneSaved; EditorSceneManager.sceneOpened += OnSceneOpened; EditorApplication.playModeStateChanged += PlayModeChanged; }
void SaveSettings() { string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsWindow); File.WriteAllText(filePath, ((int)m_SelectedMode).ToString()); }