Beispiel #1
0
        public void DeleteValue()
        {
            EditorPrefs.DeleteKey(Key);
            savedValue = DefaultValue;

            if (OnValueSaved != null)
            {
                OnValueSaved.Invoke(savedValue);
            }
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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));
            }
        }