NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
NGUISettings Class Reference

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...

Public Types

enum  ColorMode { ColorMode.Orange, ColorMode.Green, ColorMode.Blue }
 

Static Public Member Functions

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...
 

Properties

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]
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
Orange 
Green 
Blue 

Member Function Documentation

static UI2DSprite NGUISettings.Add2DSprite ( GameObject  go)
static

Convenience method – add a UnityEngine.Sprite.

static UILabel NGUISettings.AddLabel ( GameObject  go)
static

Convenience method – add a label with default parameters.

static UIPanel NGUISettings.AddPanel ( GameObject  go)
static

Convenience method – add a new panel.

static UISprite NGUISettings.AddSprite ( GameObject  go)
static

Convenience method – add a sprite.

static UITexture NGUISettings.AddTexture ( GameObject  go)
static

Convenience method – add a texture.

static UIWidget NGUISettings.AddWidget ( GameObject  go)
static

Convenience method – add a widget.

static void NGUISettings.CopyWidget ( UIWidget  widget)
static

Copy the specified widget's parameters.

static T NGUISettings.Get< T > ( string  name,
defaultValue 
)
static

Get a previously saved object from settings.

Type Constraints
T :Object 
static bool NGUISettings.GetBool ( string  name,
bool  defaultValue 
)
static

Get the previously saved boolean value.

static Color NGUISettings.GetColor ( string  name,
Color  c 
)
static

Get a previously saved color value.

static T NGUISettings.GetEnum< T > ( string  name,
defaultValue 
)
static

Get a previously saved enum from settings.

static float NGUISettings.GetFloat ( string  name,
float  defaultValue 
)
static

Get the previously saved float value.

static int NGUISettings.GetInt ( string  name,
int  defaultValue 
)
static

Get the previously saved integer value.

static string NGUISettings.GetString ( string  name,
string  defaultValue 
)
static

Get the previously saved string value.

static void NGUISettings.PasteWidget ( UIWidget  widget,
bool  fully 
)
static

Paste the specified widget's style.

static void NGUISettings.Set ( string  name,
Object  obj 
)
static

Save the specified object in settings.

static void NGUISettings.SetBool ( string  name,
bool  val 
)
static

Save the specified boolean value in settings.

static void NGUISettings.SetColor ( string  name,
Color  c 
)
static

Save the specified color value in settings.

static void NGUISettings.SetEnum ( string  name,
System.Enum  val 
)
static

Save the specified enum value to settings.

static void NGUISettings.SetFloat ( string  name,
float  val 
)
static

Save the specified float value in settings.

static void NGUISettings.SetInt ( string  name,
int  val 
)
static

Save the specified integer value in settings.

static void NGUISettings.SetString ( string  name,
string  val 
)
static

Save the specified string value in settings.

Property Documentation

bool NGUISettings.allow4096
staticgetset
Object NGUISettings.ambigiousFont
staticgetset
UIAtlas NGUISettings.atlas
staticgetset
int NGUISettings.atlasPadding
staticgetset
bool NGUISettings.atlasPMA
staticgetset
bool NGUISettings.atlasTrimming
staticgetset
Color NGUISettings.backgroundColor
staticgetset
string NGUISettings.charsToInclude
staticgetset
Color NGUISettings.color
staticgetset
ColorMode NGUISettings.colorMode
staticgetset
string NGUISettings.currentPath
staticgetset
bool NGUISettings.drawGuides
staticgetset
Font NGUISettings.dynamicFont
staticgetset
TextAsset NGUISettings.fontData
staticgetset
bool NGUISettings.fontKerning
staticgetset
int NGUISettings.fontSize
staticgetset
FontStyle NGUISettings.fontStyle
staticgetset
Texture2D NGUISettings.fontTexture
staticgetset
bool NGUISettings.forceSquareAtlas
staticgetset
Color NGUISettings.foregroundColor
staticgetset
int NGUISettings.layer
staticgetset
bool NGUISettings.minimalisticLook
staticgetset
UILabel.Overflow NGUISettings.overflowStyle
staticgetset
string NGUISettings.partialSprite
staticgetset
string NGUISettings.pathToFreeType
staticgetset
UIWidget.Pivot NGUISettings.pivot
staticgetset
string NGUISettings.searchField
staticgetset
string NGUISettings.selectedSprite
staticgetset
bool NGUISettings.showAllDCs
staticgetset
bool NGUISettings.showTransformHandles
staticgetset
Sprite NGUISettings.sprite2D
staticgetset
Texture NGUISettings.texture
staticgetset
bool NGUISettings.trueColorAtlas
staticgetset
bool NGUISettings.unifiedTransform
staticgetset
bool NGUISettings.unityPacking
staticgetset

The documentation for this class was generated from the following file: