public void DeleteValue() { EditorPrefs.DeleteKey(Key); savedValue = DefaultValue; if (OnValueSaved != null) { OnValueSaved.Invoke(savedValue); } }
public void SaveValue() { try { EditorPrefs.SetString(Key, JsonUtility.ToJson(this)); Logger.Debug("Saved value to key {0}:\n{1}", Key, EditorPrefs.GetString(Key)); if (OnValueSaved != null) { OnValueSaved.Invoke(Value); } InternalEditorUtility.RepaintAllViews(); } catch (Exception e) { Logger.Warning("Failed to save {0}: {1}", Key, e); } }
private void SaveValue() { try { EditorPrefs.SetString(Key, JsonUtility.ToJson(this)); if (OnValueSaved != null) { OnValueSaved.Invoke(Value); } InternalEditorUtility.RepaintAllViews(); } catch (Exception e) { Debug.LogWarning(string.Format("Failed to save {0}: {1}", Key, e)); } }