private void LoadSettings() { var data = EditorPrefs.GetString(LineDetectionSettingsKey, null); lineDetectionSettings = CreateInstance <LineDetectionSettings>(); try { JsonUtility.FromJsonOverwrite(data, lineDetectionSettings); } catch { // Deserialization failed, but default values are already present } serializedLineDetectionSettings = new SerializedObject(lineDetectionSettings); data = EditorPrefs.GetString(MeshBuilderSettingsKey, null); meshBuilderSettings = CreateInstance <MapMeshSettings>(); try { JsonUtility.FromJsonOverwrite(data, meshBuilderSettings); } catch { // Deserialization failed, but default values are already present } serializedMeshBuilderSettings = new SerializedObject(meshBuilderSettings); FindProperties(); }
private void LoadDefaultSettings() { lineDetectionSettings = CreateInstance <LineDetectionSettings>(); serializedLineDetectionSettings = new SerializedObject(lineDetectionSettings); meshBuilderSettings = CreateInstance <MapMeshSettings>(); serializedMeshBuilderSettings = new SerializedObject(lineDetectionSettings); FindProperties(); SaveSettings(); }