AutoPrefs.

AutoPrefs.EditorString Class

Summary

[Editor-Only] An InspectorGadgets.AutoPrefs.AutoPref`1 which encapsulates a System.String value stored in UnityEditor.EditorPrefs.
graph BT Type-->Base0["AutoPrefs.String"] click Base0 "/inspector-gadgets/api/InspectorGadgets/String" Base0-->Base1["AutoPrefs.AutoPref<string>"] Base1-->Base2["Object"] Type-.->Interface0["AutoPrefs.IAutoPref"] click Interface0 "/inspector-gadgets/api/InspectorGadgets/IAutoPref" Type["AutoPrefs.EditorString"] class Type type-node

Syntax

public class AutoPrefs.EditorString : AutoPrefs.String, AutoPrefs.IAutoPref

Constructors

Name Summary
EditorString(string, string, Action<string>) Constructs an InspectorGadgets.Editor.AutoPrefs.EditorString pref with the specified `key` and `defaultValue`.

Methods

Name Value Summary
DeletePref() void
Deletes the value of this pref from UnityEditor.EditorPrefs and reverts to the default value.
IsSaved() bool
Returns true if UnityEditor.EditorPrefs currently contains a value for this pref.
Load() string
Loads the value of this pref from UnityEditor.EditorPrefs.
Save() void
Saves the value of this pref to UnityEditor.EditorPrefs.

Operators

Name Value Summary
implicit operator AutoPrefs.EditorString(string) AutoPrefs.EditorString
implicit operator AutoPrefs.String(string) AutoPrefs.String
Inherited from AutoPrefs.String
implicit operator string(AutoPrefs.AutoPref<string>) string
Inherited from AutoPrefs.AutoPref<string>
operator !=(AutoPrefs.AutoPref<string>, string) bool
Inherited from AutoPrefs.AutoPref<string>
operator ==(AutoPrefs.AutoPref<string>, string) bool
Inherited from AutoPrefs.AutoPref<string>

Extension Methods

Name Value Summary
DoGUI<string>(GUIContent, AutoPrefs.GUIFieldMethod<string>) bool
[Editor-Only] Draws GUI controls for this pref and returns true if the value was changed.
DoGUI<string>(GUIContent, GUIStyle, AutoPrefs.GUIFieldMethod<string>) bool
[Editor-Only] Draws GUI controls for this pref and returns true if the value was changed.
DoGUI<string>(Rect, GUIContent, GUIStyle, AutoPrefs.GUIFieldMethod<string>) bool
[Editor-Only] Draws GUI controls for this pref and returns true if the value was changed.