Unity doesn't keep the values of static variables after scripts change get recompiled. One way around this is to store the references in EditorPrefs – retrieve them at start, and save them whenever something changes.
More...
|
static void | SetBool (string name, bool val) |
| Save the specified boolean value in settings. More...
|
|
static void | SetInt (string name, int val) |
| Save the specified integer value in settings. More...
|
|
static void | SetFloat (string name, float val) |
| Save the specified float value in settings. More...
|
|
static void | SetString (string name, string val) |
| Save the specified string value in settings. More...
|
|
static void | SetColor (string name, Color c) |
| Save the specified color value in settings. More...
|
|
static void | SetEnum (string name, System.Enum val) |
| Save the specified enum value to settings. More...
|
|
static void | Set (string name, Object obj) |
| Save the specified object in settings. More...
|
|
static bool | GetBool (string name, bool defaultValue) |
| Get the previously saved boolean value. More...
|
|
static int | GetInt (string name, int defaultValue) |
| Get the previously saved integer value. More...
|
|
static float | GetFloat (string name, float defaultValue) |
| Get the previously saved float value. More...
|
|
static string | GetString (string name, string defaultValue) |
| Get the previously saved string value. More...
|
|
static Color | GetColor (string name, Color c) |
| Get a previously saved color value. More...
|
|
static T | GetEnum< T > (string name, T defaultValue) |
| Get a previously saved enum from settings. More...
|
|
static T | Get< T > (string name, T defaultValue) |
| Get a previously saved object from settings. More...
|
|
static UIWidget | AddWidget (GameObject go) |
| Convenience method – add a widget. More...
|
|
static UITexture | AddTexture (GameObject go) |
| Convenience method – add a texture. More...
|
|
static UI2DSprite | Add2DSprite (GameObject go) |
| Convenience method – add a UnityEngine.Sprite. More...
|
|
static UISprite | AddSprite (GameObject go) |
| Convenience method – add a sprite. More...
|
|
static UILabel | AddLabel (GameObject go) |
| Convenience method – add a label with default parameters. More...
|
|
static UIPanel | AddPanel (GameObject go) |
| Convenience method – add a new panel. More...
|
|
static void | CopyWidget (UIWidget widget) |
| Copy the specified widget's parameters. More...
|
|
static void | PasteWidget (UIWidget widget, bool fully) |
| Paste the specified widget's style. More...
|
|
|
static bool | showTransformHandles [get, set] |
|
static bool | minimalisticLook [get, set] |
|
static bool | unifiedTransform [get, set] |
|
static Color | color [get, set] |
|
static Color | foregroundColor [get, set] |
|
static Color | backgroundColor [get, set] |
|
static ColorMode | colorMode [get, set] |
|
static Object | ambigiousFont [get, set] |
|
static UIAtlas | atlas [get, set] |
|
static Texture | texture [get, set] |
|
static Sprite | sprite2D [get, set] |
|
static string | selectedSprite [get, set] |
|
static UIWidget.Pivot | pivot [get, set] |
|
static int | layer [get, set] |
|
static TextAsset | fontData [get, set] |
|
static Texture2D | fontTexture [get, set] |
|
static int | fontSize [get, set] |
|
static bool | fontKerning [get, set] |
|
static FontStyle | fontStyle [get, set] |
|
static Font | dynamicFont [get, set] |
|
static UILabel.Overflow | overflowStyle [get, set] |
|
static string | partialSprite [get, set] |
|
static int | atlasPadding [get, set] |
|
static bool | atlasTrimming [get, set] |
|
static bool | atlasPMA [get, set] |
|
static bool | unityPacking [get, set] |
|
static bool | trueColorAtlas [get, set] |
|
static bool | forceSquareAtlas [get, set] |
|
static bool | allow4096 [get, set] |
|
static bool | showAllDCs [get, set] |
|
static bool | drawGuides [get, set] |
|
static string | charsToInclude [get, set] |
|
static string | pathToFreeType [get, set] |
|
static string | searchField [get, set] |
|
static string | currentPath [get, set] |
|
Unity doesn't keep the values of static variables after scripts change get recompiled. One way around this is to store the references in EditorPrefs – retrieve them at start, and save them whenever something changes.