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

Tools for the editor More...

Classes

struct  IntVector
 Struct type for the integer vector field below. More...
 

Static Public Member Functions

static void DrawTiledTexture (Rect rect, Texture tex)
 Draws the tiled texture. Like GUI.DrawTexture() but tiled instead of stretched. More...
 
static void DrawOutline (Rect rect)
 Draw a single-pixel outline around the specified rectangle. More...
 
static void DrawOutline (Rect rect, Color color)
 Draw a single-pixel outline around the specified rectangle. More...
 
static void DrawOutline (Rect rect, Rect relative, Color color)
 Draw a selection outline around the specified rectangle. More...
 
static void DrawOutline (Rect rect, Rect relative)
 Draw a selection outline around the specified rectangle. More...
 
static void DrawOutline (Rect rect, Rect outer, Rect inner)
 Draw a 9-sliced outline. More...
 
static Rect DrawBackground (Texture2D tex, float ratio)
 Draw a checkered background for the specified texture. More...
 
static void DrawSeparator ()
 Draw a visible separator in addition to adding some padding. More...
 
static string DrawList (string field, string[] list, string selection, params GUILayoutOption[] options)
 Convenience function that displays a list of sprites and returns the selected value. More...
 
static string DrawAdvancedList (string field, string[] list, string selection, params GUILayoutOption[] options)
 Convenience function that displays a list of sprites and returns the selected value. More...
 
static GameObject SelectedRoot ()
 Helper function that returns the selected root object. More...
 
static GameObject SelectedRoot (bool createIfMissing)
 Helper function that returns the selected root object. More...
 
static bool WillLosePrefab (GameObject root)
 Helper function that checks to see if this action would break the prefab connection. More...
 
static bool MakeTextureReadable (string path, bool force)
 Change the import settings of the specified texture asset, making it readable. More...
 
static Texture2D ImportTexture (string path, bool forInput, bool force, bool alphaTransparency)
 Fix the import settings for the specified texture, re-importing it if necessary. More...
 
static Texture2D ImportTexture (Texture tex, bool forInput, bool force, bool alphaTransparency)
 Fix the import settings for the specified texture, re-importing it if necessary. More...
 
static string GetSaveableTexturePath (UIAtlas atlas)
 Figures out the saveable filename for the texture of the specified atlas. More...
 
static string GetSelectionFolder ()
 Helper function that returns the folder where the current selection resides. More...
 
static IntVector IntPair (string prefix, string leftCaption, string rightCaption, int x, int y)
 Integer vector field. More...
 
static Rect IntRect (string prefix, Rect rect)
 Integer rectangle field. More...
 
static Vector4 IntPadding (string prefix, Vector4 v)
 Integer vector field. More...
 
static List< T > FindAll< T > ()
 Find all scene components, active or inactive. More...
 
static bool DrawPrefixButton (string text)
 
static bool DrawPrefixButton (string text, params GUILayoutOption[] options)
 
static int DrawPrefixList (int index, string[] list, params GUILayoutOption[] options)
 
static int DrawPrefixList (string text, int index, string[] list, params GUILayoutOption[] options)
 
static void DrawSprite (Texture2D tex, Rect rect, UISpriteData sprite, Color color)
 Draw a sprite preview. More...
 
static void DrawSprite (Texture2D tex, Rect drawRect, UISpriteData sprite, Color color, Material mat)
 Draw a sprite preview. More...
 
static void DrawSprite (Texture2D tex, Rect drawRect, Color color, Rect textureRect, Vector4 border)
 Draw a sprite preview. More...
 
static void DrawSprite (Texture2D tex, Rect drawRect, Color color, Material mat, int x, int y, int width, int height, int borderLeft, int borderBottom, int borderRight, int borderTop)
 Draw a sprite preview. More...
 
static void DrawTexture (Texture2D tex, Rect rect, Rect uv, Color color)
 Draw the specified sprite. More...
 
static void DrawTexture (Texture2D tex, Rect rect, Rect uv, Color color, Material mat)
 Draw the specified sprite. More...
 
static void DrawSpriteField (string label, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawPaddedSpriteField (string label, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawSpriteField (string label, string caption, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static bool DrawSpriteField (UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
 Draw a simple sprite selection button. More...
 
static void DrawSpriteField (string label, SerializedObject ob, string spriteField, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, bool removable, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, float width, bool padded, bool removable, params GUILayoutOption[] options)
 Draw a sprite selection field. More...
 
static void DrawAdvancedSpriteField (UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, bool editable, params GUILayoutOption[] options)
 Convenience function that displays a list of sprites and returns the selected value. More...
 
static void RepaintSprites ()
 Repaints all inspector windows related to sprite drawing. More...
 
static void SelectSprite (string spriteName)
 Select the specified sprite within the currently selected atlas. More...
 
static void SelectSprite (UIAtlas atlas, string spriteName)
 Select the specified atlas and sprite. More...
 
static void Select (GameObject go)
 Select the specified game object and remember what was selected before. More...
 
static void SelectPrevious ()
 Select the previous game object. More...
 
static bool IsUniform (Vector3 scale)
 Helper function that checks to see if the scale is uniform. More...
 
static bool IsUniform (GameObject go)
 Check to see if the specified game object has a uniform scale. More...
 
static void FixUniform (GameObject go)
 Fix uniform scaling of the specified object. More...
 
static bool DrawMinimalisticHeader (string text)
 Draw a distinctly different looking header label More...
 
static bool DrawHeader (string text)
 Draw a distinctly different looking header label More...
 
static bool DrawHeader (string text, string key)
 Draw a distinctly different looking header label More...
 
static bool DrawHeader (string text, bool detailed)
 Draw a distinctly different looking header label More...
 
static bool DrawHeader (string text, string key, bool forceOn, bool minimalistic)
 Draw a distinctly different looking header label More...
 
static void BeginContents ()
 Begin drawing the content area. More...
 
static void BeginContents (bool minimalistic)
 Begin drawing the content area. More...
 
static void EndContents ()
 End drawing the content area. More...
 
static void DrawEvents (string text, Object undoObject, List< EventDelegate > list)
 Draw a list of fields for the specified list of delegates. More...
 
static void DrawEvents (string text, Object undoObject, List< EventDelegate > list, bool minimalistic)
 Draw a list of fields for the specified list of delegates. More...
 
static void DrawEvents (string text, Object undoObject, List< EventDelegate > list, string noTarget, string notValid, bool minimalistic)
 Draw a list of fields for the specified list of delegates. More...
 
static SerializedProperty DrawProperty (SerializedObject serializedObject, string property, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static SerializedProperty DrawProperty (string label, SerializedObject serializedObject, string property, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static SerializedProperty DrawPaddedProperty (SerializedObject serializedObject, string property, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static SerializedProperty DrawPaddedProperty (string label, SerializedObject serializedObject, string property, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static SerializedProperty DrawProperty (string label, SerializedObject serializedObject, string property, bool padding, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static void DrawProperty (string label, SerializedProperty sp, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static void DrawProperty (string label, SerializedProperty sp, bool padding, params GUILayoutOption[] options)
 Helper function that draws a serialized property. More...
 
static void DrawBorderProperty (string name, SerializedObject serializedObject, string field)
 Helper function that draws a compact Vector4. More...
 
static void DrawRectProperty (string name, SerializedObject serializedObject, string field)
 Helper function that draws a compact Rect. More...
 
static void DrawRectProperty (string name, SerializedObject serializedObject, string field, float labelWidth, float spacing)
 Helper function that draws a compact Rect. More...
 
static float SceneViewDistanceToRectangle (Vector3[] worldPoints, Vector2 mousePos)
 Determine the distance from the mouse position to the world rectangle specified by the 4 points. More...
 
static List< UIWidgetSceneViewRaycast (Vector2 mousePos)
 Raycast into the specified panel, returning a list of widgets. Just like NGUIMath.Raycast, but doesn't rely on having a camera. More...
 
static bool SelectWidget (Vector2 pos)
 Select the topmost widget underneath the specified screen coordinate. More...
 
static bool SelectWidget (GameObject start, Vector2 pos, bool inFront)
 Select the next widget in line. More...
 
static void SetLabelWidth (float width)
 Unity 4.3 changed the way LookLikeControls works. More...
 
static void RegisterUndo (string name, params Object[] objects)
 Create an undo point for the specified objects. More...
 
static void HideMoveTool (bool hide)
 Unity 4.5+ makes it possible to hide the move tool. More...
 
static int GetClassID (System.Type type)
 Gets the internal class ID of the specified type. More...
 
static int GetClassID< T > ()
 Gets the internal class ID of the specified type. More...
 
static SerializedObject ReplaceClass (MonoBehaviour mb, System.Type type)
 Convenience function that replaces the specified MonoBehaviour with one of specified type. More...
 
static SerializedObject ReplaceClass (MonoBehaviour mb, int classID)
 Convenience function that replaces the specified MonoBehaviour with one of specified class ID. More...
 
static void ReplaceClass (SerializedObject ob, int classID)
 Convenience function that replaces the specified MonoBehaviour with one of specified class ID. More...
 
static void ReplaceClass (SerializedObject ob, System.Type type)
 Convenience function that replaces the specified MonoBehaviour with one of specified class ID. More...
 
static T ReplaceClass< T > (MonoBehaviour mb)
 Convenience function that replaces the specified MonoBehaviour with one of specified type. More...
 
static void UpgradeTexturesToSprites (UIAtlas atlas)
 Automatically upgrade all of the UITextures in the scene to Sprites if they can be found within the specified atlas. More...
 
static void ShowSpriteSelectionMenu (Vector2 screenPos)
 Show a sprite selection context menu listing all sprites under the specified screen position. More...
 
static Object LoadAsset (string path)
 Load the asset at the specified path. More...
 
static T LoadAsset< T > (string path)
 Convenience function to load an asset of specified type, given the full path to it. More...
 
static string ObjectToGUID (Object obj)
 Get the specified object's GUID. More...
 
static Object GUIDToObject (string guid)
 Convert the specified GUID to an object reference. More...
 
static T GUIDToObject< T > (string guid)
 Convert the specified GUID to an object reference of specified type. More...
 
static Color32[] AddBorder (Color32[] colors, int width, int height)
 Add a border around the specified color buffer with the width and height of a single pixel all around. The returned color buffer will have its width and height increased by 2. More...
 
static void AddShadow (Color32[] colors, int width, int height, Color shadow)
 Add a soft shadow to the specified color buffer. The buffer must have some padding around the edges in order for this to work properly. More...
 
static void AddDepth (Color32[] colors, int width, int height, Color shadow)
 Add a visual depth effect to the specified color buffer. The buffer must have some padding around the edges in order for this to work properly. More...
 
static void DrawPadding ()
 Draw 18 pixel padding on the right-hand side. Used to align fields. More...
 

Properties

static Texture2D blankTexture [get]
 Returns a blank usable 1x1 white texture. More...
 
static Texture2D backdropTexture [get]
 Returns a usable texture that looks like a dark checker board. More...
 
static Texture2D contrastTexture [get]
 Returns a usable texture that looks like a high-contrast checker board. More...
 
static Texture2D gradientTexture [get]
 Gradient texture is used for title bars / headers. More...
 
static GameObject previousSelection [get]
 Previously selected game object. More...
 

Detailed Description

Tools for the editor

Member Function Documentation

static Color32 [] NGUIEditorTools.AddBorder ( Color32[]  colors,
int  width,
int  height 
)
static

Add a border around the specified color buffer with the width and height of a single pixel all around. The returned color buffer will have its width and height increased by 2.

static void NGUIEditorTools.AddDepth ( Color32[]  colors,
int  width,
int  height,
Color  shadow 
)
static

Add a visual depth effect to the specified color buffer. The buffer must have some padding around the edges in order for this to work properly.

static void NGUIEditorTools.AddShadow ( Color32[]  colors,
int  width,
int  height,
Color  shadow 
)
static

Add a soft shadow to the specified color buffer. The buffer must have some padding around the edges in order for this to work properly.

static void NGUIEditorTools.BeginContents ( )
static

Begin drawing the content area.

static void NGUIEditorTools.BeginContents ( bool  minimalistic)
static

Begin drawing the content area.

static string NGUIEditorTools.DrawAdvancedList ( string  field,
string[]  list,
string  selection,
params GUILayoutOption[]  options 
)
static

Convenience function that displays a list of sprites and returns the selected value.

static void NGUIEditorTools.DrawAdvancedSpriteField ( UIAtlas  atlas,
string  spriteName,
SpriteSelector.Callback  callback,
bool  editable,
params GUILayoutOption[]  options 
)
static

Convenience function that displays a list of sprites and returns the selected value.

static Rect NGUIEditorTools.DrawBackground ( Texture2D  tex,
float  ratio 
)
static

Draw a checkered background for the specified texture.

static void NGUIEditorTools.DrawBorderProperty ( string  name,
SerializedObject  serializedObject,
string  field 
)
static

Helper function that draws a compact Vector4.

static void NGUIEditorTools.DrawEvents ( string  text,
Object  undoObject,
List< EventDelegate list 
)
static

Draw a list of fields for the specified list of delegates.

static void NGUIEditorTools.DrawEvents ( string  text,
Object  undoObject,
List< EventDelegate list,
bool  minimalistic 
)
static

Draw a list of fields for the specified list of delegates.

static void NGUIEditorTools.DrawEvents ( string  text,
Object  undoObject,
List< EventDelegate list,
string  noTarget,
string  notValid,
bool  minimalistic 
)
static

Draw a list of fields for the specified list of delegates.

static bool NGUIEditorTools.DrawHeader ( string  text)
static

Draw a distinctly different looking header label

static bool NGUIEditorTools.DrawHeader ( string  text,
string  key 
)
static

Draw a distinctly different looking header label

static bool NGUIEditorTools.DrawHeader ( string  text,
bool  detailed 
)
static

Draw a distinctly different looking header label

static bool NGUIEditorTools.DrawHeader ( string  text,
string  key,
bool  forceOn,
bool  minimalistic 
)
static

Draw a distinctly different looking header label

static string NGUIEditorTools.DrawList ( string  field,
string[]  list,
string  selection,
params GUILayoutOption[]  options 
)
static

Convenience function that displays a list of sprites and returns the selected value.

static bool NGUIEditorTools.DrawMinimalisticHeader ( string  text)
static

Draw a distinctly different looking header label

static void NGUIEditorTools.DrawOutline ( Rect  rect)
static

Draw a single-pixel outline around the specified rectangle.

static void NGUIEditorTools.DrawOutline ( Rect  rect,
Color  color 
)
static

Draw a single-pixel outline around the specified rectangle.

static void NGUIEditorTools.DrawOutline ( Rect  rect,
Rect  relative,
Color  color 
)
static

Draw a selection outline around the specified rectangle.

static void NGUIEditorTools.DrawOutline ( Rect  rect,
Rect  relative 
)
static

Draw a selection outline around the specified rectangle.

static void NGUIEditorTools.DrawOutline ( Rect  rect,
Rect  outer,
Rect  inner 
)
static

Draw a 9-sliced outline.

static SerializedProperty NGUIEditorTools.DrawPaddedProperty ( SerializedObject  serializedObject,
string  property,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static SerializedProperty NGUIEditorTools.DrawPaddedProperty ( string  label,
SerializedObject  serializedObject,
string  property,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static void NGUIEditorTools.DrawPaddedSpriteField ( string  label,
UIAtlas  atlas,
string  spriteName,
SpriteSelector.Callback  callback,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawPadding ( )
static

Draw 18 pixel padding on the right-hand side. Used to align fields.

static bool NGUIEditorTools.DrawPrefixButton ( string  text)
static
static bool NGUIEditorTools.DrawPrefixButton ( string  text,
params GUILayoutOption[]  options 
)
static
static int NGUIEditorTools.DrawPrefixList ( int  index,
string[]  list,
params GUILayoutOption[]  options 
)
static
static int NGUIEditorTools.DrawPrefixList ( string  text,
int  index,
string[]  list,
params GUILayoutOption[]  options 
)
static
static SerializedProperty NGUIEditorTools.DrawProperty ( SerializedObject  serializedObject,
string  property,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static SerializedProperty NGUIEditorTools.DrawProperty ( string  label,
SerializedObject  serializedObject,
string  property,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static SerializedProperty NGUIEditorTools.DrawProperty ( string  label,
SerializedObject  serializedObject,
string  property,
bool  padding,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static void NGUIEditorTools.DrawProperty ( string  label,
SerializedProperty  sp,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static void NGUIEditorTools.DrawProperty ( string  label,
SerializedProperty  sp,
bool  padding,
params GUILayoutOption[]  options 
)
static

Helper function that draws a serialized property.

static void NGUIEditorTools.DrawRectProperty ( string  name,
SerializedObject  serializedObject,
string  field 
)
static

Helper function that draws a compact Rect.

static void NGUIEditorTools.DrawRectProperty ( string  name,
SerializedObject  serializedObject,
string  field,
float  labelWidth,
float  spacing 
)
static

Helper function that draws a compact Rect.

static void NGUIEditorTools.DrawSeparator ( )
static

Draw a visible separator in addition to adding some padding.

static void NGUIEditorTools.DrawSprite ( Texture2D  tex,
Rect  rect,
UISpriteData  sprite,
Color  color 
)
static

Draw a sprite preview.

static void NGUIEditorTools.DrawSprite ( Texture2D  tex,
Rect  drawRect,
UISpriteData  sprite,
Color  color,
Material  mat 
)
static

Draw a sprite preview.

static void NGUIEditorTools.DrawSprite ( Texture2D  tex,
Rect  drawRect,
Color  color,
Rect  textureRect,
Vector4  border 
)
static

Draw a sprite preview.

static void NGUIEditorTools.DrawSprite ( Texture2D  tex,
Rect  drawRect,
Color  color,
Material  mat,
int  x,
int  y,
int  width,
int  height,
int  borderLeft,
int  borderBottom,
int  borderRight,
int  borderTop 
)
static

Draw a sprite preview.

static void NGUIEditorTools.DrawSpriteField ( string  label,
UIAtlas  atlas,
string  spriteName,
SpriteSelector.Callback  callback,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawSpriteField ( string  label,
string  caption,
UIAtlas  atlas,
string  spriteName,
SpriteSelector.Callback  callback,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static bool NGUIEditorTools.DrawSpriteField ( UIAtlas  atlas,
string  spriteName,
SpriteSelector.Callback  callback,
params GUILayoutOption[]  options 
)
static

Draw a simple sprite selection button.

static void NGUIEditorTools.DrawSpriteField ( string  label,
SerializedObject  ob,
string  spriteField,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawSpriteField ( string  label,
SerializedObject  ob,
SerializedProperty  atlas,
SerializedProperty  sprite,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawSpriteField ( string  label,
SerializedObject  ob,
SerializedProperty  atlas,
SerializedProperty  sprite,
bool  removable,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawSpriteField ( string  label,
SerializedObject  ob,
SerializedProperty  atlas,
SerializedProperty  sprite,
float  width,
bool  padded,
bool  removable,
params GUILayoutOption[]  options 
)
static

Draw a sprite selection field.

static void NGUIEditorTools.DrawTexture ( Texture2D  tex,
Rect  rect,
Rect  uv,
Color  color 
)
static

Draw the specified sprite.

static void NGUIEditorTools.DrawTexture ( Texture2D  tex,
Rect  rect,
Rect  uv,
Color  color,
Material  mat 
)
static

Draw the specified sprite.

static void NGUIEditorTools.DrawTiledTexture ( Rect  rect,
Texture  tex 
)
static

Draws the tiled texture. Like GUI.DrawTexture() but tiled instead of stretched.

static void NGUIEditorTools.EndContents ( )
static

End drawing the content area.

static List<T> NGUIEditorTools.FindAll< T > ( )
static

Find all scene components, active or inactive.

Type Constraints
T :Component 
static void NGUIEditorTools.FixUniform ( GameObject  go)
static

Fix uniform scaling of the specified object.

static int NGUIEditorTools.GetClassID ( System.Type  type)
static

Gets the internal class ID of the specified type.

static int NGUIEditorTools.GetClassID< T > ( )
static

Gets the internal class ID of the specified type.

Type Constraints
T :MonoBehaviour 
static string NGUIEditorTools.GetSaveableTexturePath ( UIAtlas  atlas)
static

Figures out the saveable filename for the texture of the specified atlas.

static string NGUIEditorTools.GetSelectionFolder ( )
static

Helper function that returns the folder where the current selection resides.

static Object NGUIEditorTools.GUIDToObject ( string  guid)
static

Convert the specified GUID to an object reference.

static T NGUIEditorTools.GUIDToObject< T > ( string  guid)
static

Convert the specified GUID to an object reference of specified type.

Type Constraints
T :Object 
static void NGUIEditorTools.HideMoveTool ( bool  hide)
static

Unity 4.5+ makes it possible to hide the move tool.

static Texture2D NGUIEditorTools.ImportTexture ( string  path,
bool  forInput,
bool  force,
bool  alphaTransparency 
)
static

Fix the import settings for the specified texture, re-importing it if necessary.

static Texture2D NGUIEditorTools.ImportTexture ( Texture  tex,
bool  forInput,
bool  force,
bool  alphaTransparency 
)
static

Fix the import settings for the specified texture, re-importing it if necessary.

static Vector4 NGUIEditorTools.IntPadding ( string  prefix,
Vector4  v 
)
static

Integer vector field.

static IntVector NGUIEditorTools.IntPair ( string  prefix,
string  leftCaption,
string  rightCaption,
int  x,
int  y 
)
static

Integer vector field.

static Rect NGUIEditorTools.IntRect ( string  prefix,
Rect  rect 
)
static

Integer rectangle field.

static bool NGUIEditorTools.IsUniform ( Vector3  scale)
static

Helper function that checks to see if the scale is uniform.

static bool NGUIEditorTools.IsUniform ( GameObject  go)
static

Check to see if the specified game object has a uniform scale.

static Object NGUIEditorTools.LoadAsset ( string  path)
static

Load the asset at the specified path.

static T NGUIEditorTools.LoadAsset< T > ( string  path)
static

Convenience function to load an asset of specified type, given the full path to it.

Type Constraints
T :Object 
static bool NGUIEditorTools.MakeTextureReadable ( string  path,
bool  force 
)
static

Change the import settings of the specified texture asset, making it readable.

static string NGUIEditorTools.ObjectToGUID ( Object  obj)
static

Get the specified object's GUID.

static void NGUIEditorTools.RegisterUndo ( string  name,
params Object[]  objects 
)
static

Create an undo point for the specified objects.

static void NGUIEditorTools.RepaintSprites ( )
static

Repaints all inspector windows related to sprite drawing.

static SerializedObject NGUIEditorTools.ReplaceClass ( MonoBehaviour  mb,
System.Type  type 
)
static

Convenience function that replaces the specified MonoBehaviour with one of specified type.

static SerializedObject NGUIEditorTools.ReplaceClass ( MonoBehaviour  mb,
int  classID 
)
static

Convenience function that replaces the specified MonoBehaviour with one of specified class ID.

static void NGUIEditorTools.ReplaceClass ( SerializedObject  ob,
int  classID 
)
static

Convenience function that replaces the specified MonoBehaviour with one of specified class ID.

static void NGUIEditorTools.ReplaceClass ( SerializedObject  ob,
System.Type  type 
)
static

Convenience function that replaces the specified MonoBehaviour with one of specified class ID.

static T NGUIEditorTools.ReplaceClass< T > ( MonoBehaviour  mb)
static

Convenience function that replaces the specified MonoBehaviour with one of specified type.

Type Constraints
T :MonoBehaviour 
static float NGUIEditorTools.SceneViewDistanceToRectangle ( Vector3[]  worldPoints,
Vector2  mousePos 
)
static

Determine the distance from the mouse position to the world rectangle specified by the 4 points.

static List<UIWidget> NGUIEditorTools.SceneViewRaycast ( Vector2  mousePos)
static

Raycast into the specified panel, returning a list of widgets. Just like NGUIMath.Raycast, but doesn't rely on having a camera.

static void NGUIEditorTools.Select ( GameObject  go)
static

Select the specified game object and remember what was selected before.

static GameObject NGUIEditorTools.SelectedRoot ( )
static

Helper function that returns the selected root object.

static GameObject NGUIEditorTools.SelectedRoot ( bool  createIfMissing)
static

Helper function that returns the selected root object.

static void NGUIEditorTools.SelectPrevious ( )
static

Select the previous game object.

static void NGUIEditorTools.SelectSprite ( string  spriteName)
static

Select the specified sprite within the currently selected atlas.

static void NGUIEditorTools.SelectSprite ( UIAtlas  atlas,
string  spriteName 
)
static

Select the specified atlas and sprite.

static bool NGUIEditorTools.SelectWidget ( Vector2  pos)
static

Select the topmost widget underneath the specified screen coordinate.

static bool NGUIEditorTools.SelectWidget ( GameObject  start,
Vector2  pos,
bool  inFront 
)
static

Select the next widget in line.

static void NGUIEditorTools.SetLabelWidth ( float  width)
static

Unity 4.3 changed the way LookLikeControls works.

static void NGUIEditorTools.ShowSpriteSelectionMenu ( Vector2  screenPos)
static

Show a sprite selection context menu listing all sprites under the specified screen position.

static void NGUIEditorTools.UpgradeTexturesToSprites ( UIAtlas  atlas)
static

Automatically upgrade all of the UITextures in the scene to Sprites if they can be found within the specified atlas.

static bool NGUIEditorTools.WillLosePrefab ( GameObject  root)
static

Helper function that checks to see if this action would break the prefab connection.

Property Documentation

Texture2D NGUIEditorTools.backdropTexture
staticget

Returns a usable texture that looks like a dark checker board.

Texture2D NGUIEditorTools.blankTexture
staticget

Returns a blank usable 1x1 white texture.

Texture2D NGUIEditorTools.contrastTexture
staticget

Returns a usable texture that looks like a high-contrast checker board.

Texture2D NGUIEditorTools.gradientTexture
staticget

Gradient texture is used for title bars / headers.

GameObject NGUIEditorTools.previousSelection
staticget

Previously selected game object.


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