All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyCommonEditor.plyEdGUI Class Reference

Editor GUI class with lots of useful functions and the custom styling used with all tools I develop. More...

Static Public Member Functions

static void UseSkin ()
 This should be the first call in OnGUI() to make sure the custom styles are loaded and ready for use. More...
 
static Texture2D LoadEditorTexture (string fn)
 Helper for loading a texture. Will print warning message to the console if failed to load the texture. More...
 
static Texture2D LoadTextureResource (string fullResourceName, Assembly assembly)
 Load embedded texture resources. More...
 
static byte[] GetByteResource (string fullResourceName, Assembly assembly)
 
static LayerMask LayerMaskField (string label, LayerMask selected, int width)
 Shows a Layer Mask field similar to the one in the Inspector More...
 
static string PathField (string path, string label, string dialogTitle, int labelWidth, int buttonWidth)
 Show a browse button which opens the EditorUtility.SaveFolderPanel) when clicked. The path is shown as text on the button. More...
 
static string FileField (string path, string label, string dialogTitle, string defaultName, string extension, int labelWidth, int buttonWidth)
 Show a browse button which opens the EditorUtility.SaveFilePanel() when clicked. The path is shown as text on the button. More...
 
static string RelativeFileField (string path, string label, string dialogTitle, string extention, int labelWidth, int buttonWidth)
 Show a browse button which opens the EditorUtility.OpenFilePanel(. The shown and returned path is a relative path. More...
 
static int Popup (string label, int sel, string[] items)
 Same as EditorGUILayout.Popup but with added 'clear' button to set selected to -1 More...
 
static string PopupTextField (string label, string val, string[] items)
 A text field with a little button that allow user to select values from a popup rather than entering them manually into the text field. More...
 
static bool CurveField (plyCurve curve, int width, int height, Color col)
 Shows a plyCurve. Return true if curve editor should be opened (when user clicked on the field). More...
 
static int AngleField (string label, int angle, int min, int max, Color color, int width, int height, int radius, int maxRadius)
 Draws a circle or arc. Has a slider to change angle of the arc. More...
 
static bool MetaDataField (plyMetaData metaData, params GUILayoutOption[] layoutOptions)
 Field for changing plyMetaData value depending on its type. Return true if value changed. More...
 
static bool MetaDataEditor (ref int selectedIdx, ref plyMetaData[] metaData, BasicCallback repaintCallback, GeneralCallback saveCallback, object[] saveArgs)
 
static bool ToggleButton (bool active, string label, GUIStyle style, params GUILayoutOption[] options)
 This toggle does not return the new state but rather if the state has changed (true) or not (false) More...
 
static bool ToggleButton (bool active, GUIContent label, GUIStyle style, params GUILayoutOption[] options)
 This toggle does not return the new state but rather if the state has changed (true) or not (false) More...
 
static bool ToggleButton (Rect r, bool active, GUIContent label, GUIStyle style)
 This toggle does not return the new state but rather if the state has changed (true) or not (false) More...
 
static bool LabelButton (string label, string button, int labelWidth, int buttonWidth)
 Show a button that has a label on the same line. More...
 
static void SectionHeading (string label)
 Draw a label in a large font with horizontal underline. Layout should be in vertical else this will render wrong. More...
 
static void SectionHeading (string label, bool includeLine)
 Draw a label in a large font with horizontal underline. Layout should be in vertical else this will render wrong. More...
 
static void HLine (int topSpacing)
 Used to draw the horizontal underline you would normally get with plyEdGui.Heading(). Layout should be in vertical else this will render wrong. More...
 
static void HLine (int topSpacing, int bottomSpacing)
 Used to draw the horizontal underline you would normally get with plyEdGui.Heading(). Layout should be in vertical else this will render wrong. More...
 
static int Menu (int selected, string[] menuItems, params GUILayoutOption[] options)
 Draw a menu (similar to the one in Unity Preferences). If the menuItem's name starts with "-" then that will be a separator. If the "-" is followed by more characters then that separator will be a heading. A null/empty string for menuItem will also cause a separator/space in the menu. More...
 
static int Menu (int selected, GUIContent[] menuItems, params GUILayoutOption[] options)
 Draw a menu (similar to the one in Unity Preferences). If the menuItem's name starts with "-" then that will be a separator. If the "-" is followed by more characters then that separator will have a heading. A null/empty/none content for menuItem will also cause a separator/space in the menu. More...
 
static bool ItemsList< T > (ref T selected, List< T > items, bool canCopy, bool canRename, bool confirmDelete, bool supportStyleOverride, ResultCallback callback, ref Vector2 scroll, string helpUrl, string emptyLabel, params GUILayoutOption[] options)
 Draws a List of items. Show buttons to Add, Copy and Delete these items. Returns TRUE when selected item changed. Draws a scrollbar if needed. More...
 
static bool ItemsList< T > (ref T selected, List< T > items, bool canCopy, bool canRename, bool confirmDelete, bool supportStyleOverride, ResultCallback callback, ref Vector2 scroll, string helpUrl, string emptyLabel, bool menuStyle, GUIContent[] extraIcons, BasicCallback[] extraCallbacks, params GUILayoutOption[] options)
 Draws a List of items. Show buttons to Add, Copy and Delete these items. Returns TRUE when selected item changed. Draws a scrollbar if needed. More...
 
static int SimpleItemList< T > (ref T selected, List< T > items, string heading)
 Show a toolbar with heading, add and delete buttons, and then the list of items. It uses the Item's "ToString" to get the value to show in the List Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete More...
 
static int SimpleItemList< T > (ref T selected, List< T > items, string heading, GeneralCallback drawCallback, params GUILayoutOption[] options)
 Show a toolbar with heading, add and delete buttons, and then the list of items. It calls drawCallback to draw an item in a Horizontal layout. args[0] = index of item to draw Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete More...
 
static bool SimpleList< T > (ref T selected, List< T > items, string emptyLabel, params GUILayoutOption[] options)
 Shows a list of items. More...
 
static int SimpleItemList< T > (ref int selected, List< T > items, string heading, GeneralCallback drawCallback, params GUILayoutOption[] options)
 Show a toolbar with heading, add and delete buttons, and then the list of items. It calls drawCallback to draw an item in a Horizontal layout. args[0] = index of item to draw Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete More...
 
static int SimpleItemArray (ref int selectedIdx, System.Array items, string heading, GeneralCallback drawCallback, object[] args)
 Show a toolbar with heading, add and delete buttons, and then the list of items. It updates selectedIdx with the index of the selected item. selectedIdx=-1 means nothing is selected. It calls drawCallback to draw an item in a Horizontal layout with the following args[0] = index of item to draw args[1+] = custom args It Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete More...
 
static void DrawHorizontalLine (int thickness, int width, Color color, GUIStyle style)
 Draw a horizontal line. More...
 
static void DrawHorizontalLine (int thickness, int width, Color color, GUIStyle style, int marginTop, int marginBottom)
 Draw a horizontal line. More...
 
static void DrawVerticalLine (int thickness, int height, Color color, GUIStyle style, int marginLeft, int marginRight)
 Draw a vertical line. More...
 
static void DrawCurveLine (Rect containedArea, Vector3 startPos, Vector3 endPos, Color color, float thickness, bool drawShadow)
 Draw a Bezier curve line. More...
 
static void DrawGrid (Rect r, int xSpacing, int ySpacing, int linesPerMajor, Vector2 linesOffset, Color backColor, Color majorLineColor, Color minorLineColor)
 Draws a Grid. More...
 
static void DrawBlocksGrid (Rect r, int blockSize, Color majorColor, Color minorColor)
 Draw a grid that consist of altering colored blocks. More...
 
static void ClearFocus ()
 
static void LookLikeControls ()
 
static void LookLikeControls (float labelWidth)
 
static void LookLikeControls (float labelWidth, float fieldWidth)
 

Static Public Attributes

static GUISkin Skin = null
 Skin that includes the custom Styles.
 
static Color DividerColor = new Color(0.35f, 0.35f, 0.35f, 1f)
 
static Color GridLineMinorColor = new Color(0f, 0f, 0f, 0.1f)
 
static Color GridLineMajorColor = new Color(0f, 0f, 0f, 0.3f)
 
static Color ColorTealTrans = new Color(0.002f, 0.515f, 0.507f, 0.45f)
 
static Color ColorFuchsiaTrans = new Color(0.714f, 0.429f, 0.718f, 0.45f)
 
static Color IconColor = EditorGUIUtility.isProSkin ? new Color(0.705f, 0.705f, 0.705f, 1.000f) : new Color(0.000f, 0.000f, 0.000f, 1.000f)
 
static GUIStyle EmptyStyle = new GUIStyle()
 
static GUIStyle LargeBoldLabelStyle
 
static GUIStyle LargeFALabelStyle
 
static GUIStyle TextAreaStyle
 
static GUIStyle TextFieldNoLRMarginStyle
 
static GUIStyle TextFieldNoRightMarginStyle
 
static GUIStyle RightAlignLabelStyle
 
static GUIStyle CenterAlignLabelStyle
 
static GUIStyle WrappedRichTextLabelStyle
 
static GUIStyle RichTextBoldLabelStyle
 
static GUIStyle PaddingHelperStyle
 
static GUIStyle LRPaddingHelperStyle
 
static GUIStyle BoxNoPaddingStyle
 
static GUIStyle ButtonLeftStyle
 
static GUIStyle ButtonMidStyle
 
static GUIStyle ButtonRightStyle
 
static GUIStyle IconButtonLeftStyle
 
static GUIStyle IconButtonMidStyle
 
static GUIStyle IconButtonRightStyle
 
static GUIStyle MiniIconButtonLeftStyle
 
static GUIStyle MiniIconButtonMidStyle
 
static GUIStyle MiniIconButtonRightStyle
 
static Color MainToolbarDividerColor = new Color(0f, 0.5f, 0.8f, 1f)
 
static GUIStyle MainToolbarStyle
 
static GUIStyle MainToolbarButtonLeftStyle
 
static GUIStyle MainToolbarButtonMidStyle
 
static GUIStyle MainToolbarButtonRightStyle
 
static GUIStyle ToolbarStyle
 
static GUIStyle ToolbarIconButtonStyle
 
static GUIStyle ToolbarButtonStyle
 
static GUIStyle ToolbarPopupStyle
 
static GUIStyle ToolbarLabelStyle
 
static GUIStyle ToolbarHeadStyle
 
static GUIStyle ToolbarTextFieldStyle
 
static GUIStyle ItemListBoxStyle
 
static GUIStyle ItemListHeadStyle
 
static GUIStyle ItemListButtonStyle
 
static GUIStyle ItemListEntry1Style
 
static GUIStyle ItemListEntry2Style
 
static GUIStyle ItemListEntrySelectedStyle
 
static GUIStyle FlatIconButtonStyle
 
static GUIStyle FlatIconButtonSmallStyle
 
static GUIStyle MenuBoxStyle
 
static GUIStyle MenuItemStyle
 
static GUIStyle MenuHeadStyle
 
static GUIStyle MenuListItemStyle1
 
static GUIStyle MenuListItemStyle2
 
static GUIStyle MenuListItemMarginStyle1
 
static GUIStyle MenuListItemMarginStyle2
 
static GUIStyle SplitterStyle
 
static GUIStyle FlatWhiteStyle
 
static GUIStyle HLineStyle
 
static GUIStyle InnerShadowStyle
 
static GUIStyle AboutLogoAreaStyle
 
static Texture2D Texture_ItemListBox
 
static Texture2D Texture_ItemListButtonN
 
static Texture2D Texture_ItemListButtonA
 
static Texture2D Texture_ItemListEntry1
 
static Texture2D Texture_ItemListEntry2
 
static Texture2D Texture_ItemListSelected
 
static Texture2D Texture_MainToolButtonSelected
 
static Texture2D Texture_MenuBox
 
static Texture2D Texture_MenuListItem1
 
static Texture2D Texture_MenuListItem2
 
static Texture2D Texture_MenuItemSelected
 
static Texture2D Texture_Splitter
 
static Texture2D Texture_InnerShadow
 
static Texture2D Texture_ListItemAddButton
 
static Texture2D Texture_ListItemRenButton
 
static Texture2D Texture_ListItemDelButton
 
static Texture2D Texture_ListItemDel2Button
 
static Texture2D Texture_ListItemCpyButton
 
static Texture2D Texture_ListItemHlpButton
 
static Texture2D Texture_ListItemUpButton
 
static Texture2D Texture_ListItemDwnButton
 
static Texture2D Texture_Bezier
 
static GUIContent GC_Add
 
static GUIContent GC_Copy
 
static GUIContent GC_Delete
 
static GUIContent GC_Remove
 
static GUIContent GC_Rename
 
static GUIContent GC_Help
 
static GUIContent GC_ListUp
 
static GUIContent GC_ListDown
 
static GUIContent GC_Settings
 
static GUIContent GC_Left
 
static GUIContent GC_Right
 
static GUIContent GC_ListItemAddButton
 
static GUIContent GC_ListItemDelButton
 
static GUIContent GC_ListItemCpyButton
 
static GUIContent GC_ListItemRenButton
 
static GUIContent GC_ListItemHlpButton
 
static GUIContent GC_ListItemUpButton
 
static GUIContent GC_ListItemDwnButton
 
static GUIContent GC_Heading
 

Properties

static string ResPath [get]
 Path to the resources folder. Default, if not moved, is 'Assets/plyoung/edRes/' More...
 

Detailed Description

Editor GUI class with lots of useful functions and the custom styling used with all tools I develop.

Member Function Documentation

static int plyCommonEditor.plyEdGUI.AngleField ( string  label,
int  angle,
int  min,
int  max,
Color  color,
int  width,
int  height,
int  radius,
int  maxRadius 
)
static

Draws a circle or arc. Has a slider to change angle of the arc.

Parameters
labelLabel of field.
angleThe current angle.
minThe minimum the angle can be.
maxThe maximum the angle can be.
colorThe color to draw arc in.
widthThe width of box arc is in.
heightThe height of box the arc is in.
radiusThe radius of the arc.
maxRadiusThe maximum radius it can reach.
Returns
The current angle.
static bool plyCommonEditor.plyEdGUI.CurveField ( plyCurve  curve,
int  width,
int  height,
Color  col 
)
static

Shows a plyCurve. Return true if curve editor should be opened (when user clicked on the field).

static void plyCommonEditor.plyEdGUI.DrawBlocksGrid ( Rect  r,
int  blockSize,
Color  majorColor,
Color  minorColor 
)
static

Draw a grid that consist of altering colored blocks.

Parameters
rThe Rect area to draw grid in.
blockSizeSize of a block.
majorColorThe major blocks color.
minorColorThe minor blocks color.
static void plyCommonEditor.plyEdGUI.DrawCurveLine ( Rect  containedArea,
Vector3  startPos,
Vector3  endPos,
Color  color,
float  thickness,
bool  drawShadow 
)
static

Draw a Bezier curve line.

static void plyCommonEditor.plyEdGUI.DrawGrid ( Rect  r,
int  xSpacing,
int  ySpacing,
int  linesPerMajor,
Vector2  linesOffset,
Color  backColor,
Color  majorLineColor,
Color  minorLineColor 
)
static

Draws a Grid.

Parameters
rThe Rect area to draw grid in.
xSpacingThe x spacing between grid lines.
ySpacingThe y spacing between grid lines.
linesPerMajorPassing linesPerMajor=0 will cause major lines to not be drawn, else a 'major' line is drawing every so many units.
linesOffsetThe lines offset. useful when you want to show scrolling in the grid.
backColorThe background color.
majorLineColorThe major line color.
minorLineColorThe minor line color.
static void plyCommonEditor.plyEdGUI.DrawHorizontalLine ( int  thickness,
int  width,
Color  color,
GUIStyle  style 
)
static

Draw a horizontal line.

static void plyCommonEditor.plyEdGUI.DrawHorizontalLine ( int  thickness,
int  width,
Color  color,
GUIStyle  style,
int  marginTop,
int  marginBottom 
)
static

Draw a horizontal line.

static void plyCommonEditor.plyEdGUI.DrawVerticalLine ( int  thickness,
int  height,
Color  color,
GUIStyle  style,
int  marginLeft,
int  marginRight 
)
static

Draw a vertical line.

static string plyCommonEditor.plyEdGUI.FileField ( string  path,
string  label,
string  dialogTitle,
string  defaultName,
string  extension,
int  labelWidth,
int  buttonWidth 
)
static

Show a browse button which opens the EditorUtility.SaveFilePanel() when clicked. The path is shown as text on the button.

static void plyCommonEditor.plyEdGUI.HLine ( int  topSpacing)
static

Used to draw the horizontal underline you would normally get with plyEdGui.Heading(). Layout should be in vertical else this will render wrong.

static void plyCommonEditor.plyEdGUI.HLine ( int  topSpacing,
int  bottomSpacing 
)
static

Used to draw the horizontal underline you would normally get with plyEdGui.Heading(). Layout should be in vertical else this will render wrong.

static bool plyCommonEditor.plyEdGUI.ItemsList< T > ( ref T  selected,
List< T >  items,
bool  canCopy,
bool  canRename,
bool  confirmDelete,
bool  supportStyleOverride,
ResultCallback  callback,
ref Vector2  scroll,
string  helpUrl,
string  emptyLabel,
params GUILayoutOption[]  options 
)
static

Draws a List of items. Show buttons to Add, Copy and Delete these items. Returns TRUE when selected item changed. Draws a scrollbar if needed.

Template Parameters
TGeneric type parameter.
Parameters
selected[in,out] The selected item.
itemsThe items to show.
canCopytrue if copy button should be shown.
canRenametrue if rename button should be shown.
callbackA callback to call when changes occur in the list or when you should act on a request. You normally want to use EditorUtility.SetDirty() when your callback is called to set the object, that contains the list, to dirty (so change are serialised). The callback args parameter will contain the following int value as first value in the args array ( args[0]):
  • 1 = wants you to create a new item and return it (you must also add it to the list
  • 2 = wants you to make a copy and add it to the list. The item to copy will be in args[1]
  • 3 = called just before deleting the item. args[1] is a reference to the item that is about to be deleted, args[2] = its position
  • 4 = called after delete is done. You should return which item should be set as "selected", if anything (else you can simply return null)
  • 5 = selected item's position changed in the list args[1]=previous pos, args[2]=new pos
  • 6 = rename button was pressed. You probably want to use the plyTextInputWiz to show an input field where the user can enter a new name for the item. You should manage the actual renaming of the item.
  • 7 = an item about to be rendered. you can return a GUIStyle override to use. args[1] = the item, args[2] = the style that will be used
scroll[in,out] Position of the scrollbar.
helpUrlThe URL that will be opened when the Help button is clicked. Pass null to not show the help button.
emptyLabelA message to show in the list when there are no items in it.
optionsLayout options.
Returns
Returns true when the selection (selected) changed.
static bool plyCommonEditor.plyEdGUI.ItemsList< T > ( ref T  selected,
List< T >  items,
bool  canCopy,
bool  canRename,
bool  confirmDelete,
bool  supportStyleOverride,
ResultCallback  callback,
ref Vector2  scroll,
string  helpUrl,
string  emptyLabel,
bool  menuStyle,
GUIContent[]  extraIcons,
BasicCallback[]  extraCallbacks,
params GUILayoutOption[]  options 
)
static

Draws a List of items. Show buttons to Add, Copy and Delete these items. Returns TRUE when selected item changed. Draws a scrollbar if needed.

Template Parameters
TGeneric type parameter.
Parameters
selected[in,out] The selected item.
itemsThe items to show.
canCopytrue if copy button should be shown.
canRenametrue if rename button should be shown.
callbackA callback to call when changes occur in the list or when you should act on a request. You normally want to use EditorUtility.SetDirty() when your callback is called to set the object, that contains the list, to dirty (so change are serialised). The callback args parameter will contain the following int value as first value in the args array ( args[0]):
  • 1 = wants you to create a new item and return it (you must also add it to the list
  • 2 = wants you to make a copy and add it to the list. The item to copy will be in args[1]
  • 3 = called just before deleting the item. args[1] is a reference to the item that is about to be deleted, args[2] = its position
  • 4 = called after delete is done. You should return which item should be set as "selected", if anything (else you can simply return null)
  • 5 = selected item's position changed in the list. args[1]=previous pos, args[2]=new pos
  • 6 = rename button was pressed. You probably want to use the plyTextInputWiz to show an input field where the user can enter a new name for the item. You should manage the actual renaming of the item.
  • 7 = an item about to be rendered. you can return a GUIStyle override to use. args[1] = the item, args[2] = the style that will be used
scroll[in,out] Position of the scrollbar.
helpUrlThe URL that will be opened when the Help button is clicked. Pass null to not show the help button.
emptyLabelA message to show in the list when there are no items in it.
menuStyleStyle to use for menu.
extraIconsAddition icons to show on the toolbar. Set to null if you do not want to use it.
extraCallbacksCallback to call when associated extra icon was pressed. Set to null if you do not want to use it.
optionsLayout options.
Returns
Returns true when the selected changed.
static bool plyCommonEditor.plyEdGUI.LabelButton ( string  label,
string  button,
int  labelWidth,
int  buttonWidth 
)
static

Show a button that has a label on the same line.

static LayerMask plyCommonEditor.plyEdGUI.LayerMaskField ( string  label,
LayerMask  selected,
int  width 
)
static

Shows a Layer Mask field similar to the one in the Inspector

static Texture2D plyCommonEditor.plyEdGUI.LoadEditorTexture ( string  fn)
static

Helper for loading a texture. Will print warning message to the console if failed to load the texture.

static Texture2D plyCommonEditor.plyEdGUI.LoadTextureResource ( string  fullResourceName,
Assembly  assembly 
)
static

Load embedded texture resources.

static int plyCommonEditor.plyEdGUI.Menu ( int  selected,
string[]  menuItems,
params GUILayoutOption[]  options 
)
static

Draw a menu (similar to the one in Unity Preferences). If the menuItem's name starts with "-" then that will be a separator. If the "-" is followed by more characters then that separator will be a heading. A null/empty string for menuItem will also cause a separator/space in the menu.

Returns
The currently selected/ highlighted menu item.
static int plyCommonEditor.plyEdGUI.Menu ( int  selected,
GUIContent[]  menuItems,
params GUILayoutOption[]  options 
)
static

Draw a menu (similar to the one in Unity Preferences). If the menuItem's name starts with "-" then that will be a separator. If the "-" is followed by more characters then that separator will have a heading. A null/empty/none content for menuItem will also cause a separator/space in the menu.

Returns
The currently selected/ highlighted menu item.
static bool plyCommonEditor.plyEdGUI.MetaDataField ( plyMetaData  metaData,
params GUILayoutOption[]  layoutOptions 
)
static

Field for changing plyMetaData value depending on its type. Return true if value changed.

static string plyCommonEditor.plyEdGUI.PathField ( string  path,
string  label,
string  dialogTitle,
int  labelWidth,
int  buttonWidth 
)
static

Show a browse button which opens the EditorUtility.SaveFolderPanel) when clicked. The path is shown as text on the button.

static int plyCommonEditor.plyEdGUI.Popup ( string  label,
int  sel,
string[]  items 
)
static

Same as EditorGUILayout.Popup but with added 'clear' button to set selected to -1

static string plyCommonEditor.plyEdGUI.PopupTextField ( string  label,
string  val,
string[]  items 
)
static

A text field with a little button that allow user to select values from a popup rather than entering them manually into the text field.

static string plyCommonEditor.plyEdGUI.RelativeFileField ( string  path,
string  label,
string  dialogTitle,
string  extention,
int  labelWidth,
int  buttonWidth 
)
static

Show a browse button which opens the EditorUtility.OpenFilePanel(. The shown and returned path is a relative path.

static void plyCommonEditor.plyEdGUI.SectionHeading ( string  label)
static

Draw a label in a large font with horizontal underline. Layout should be in vertical else this will render wrong.

static void plyCommonEditor.plyEdGUI.SectionHeading ( string  label,
bool  includeLine 
)
static

Draw a label in a large font with horizontal underline. Layout should be in vertical else this will render wrong.

static int plyCommonEditor.plyEdGUI.SimpleItemArray ( ref int  selectedIdx,
System.Array  items,
string  heading,
GeneralCallback  drawCallback,
object[]  args 
)
static

Show a toolbar with heading, add and delete buttons, and then the list of items. It updates selectedIdx with the index of the selected item. selectedIdx=-1 means nothing is selected. It calls drawCallback to draw an item in a Horizontal layout with the following args[0] = index of item to draw args[1+] = custom args It Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete

static int plyCommonEditor.plyEdGUI.SimpleItemList< T > ( ref T  selected,
List< T >  items,
string  heading 
)
static

Show a toolbar with heading, add and delete buttons, and then the list of items. It uses the Item's "ToString" to get the value to show in the List Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete

static int plyCommonEditor.plyEdGUI.SimpleItemList< T > ( ref T  selected,
List< T >  items,
string  heading,
GeneralCallback  drawCallback,
params GUILayoutOption[]  options 
)
static

Show a toolbar with heading, add and delete buttons, and then the list of items. It calls drawCallback to draw an item in a Horizontal layout. args[0] = index of item to draw Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete

static int plyCommonEditor.plyEdGUI.SimpleItemList< T > ( ref int  selected,
List< T >  items,
string  heading,
GeneralCallback  drawCallback,
params GUILayoutOption[]  options 
)
static

Show a toolbar with heading, add and delete buttons, and then the list of items. It calls drawCallback to draw an item in a Horizontal layout. args[0] = index of item to draw Return 0: Nothing changed 1: Another Item selected in List 2: The Add button was pressed. You need to handle the actual addition of an item to the list 10: (or greater) An item must be deleted. The returned value is the index of the item plus 10 so use (idx = result - 10) to get index of item to delete

static bool plyCommonEditor.plyEdGUI.SimpleList< T > ( ref T  selected,
List< T >  items,
string  emptyLabel,
params GUILayoutOption[]  options 
)
static

Shows a list of items.

Template Parameters
TGeneric type parameter.
Parameters
selected[in,out] The selected item.
itemsThe items to show.
emptyLabelA message to show in the list when there are no items in it.
optionsLayout options.
Returns
Returns true when the selection (selected) changed.
static bool plyCommonEditor.plyEdGUI.ToggleButton ( bool  active,
string  label,
GUIStyle  style,
params GUILayoutOption[]  options 
)
static

This toggle does not return the new state but rather if the state has changed (true) or not (false)

static bool plyCommonEditor.plyEdGUI.ToggleButton ( bool  active,
GUIContent  label,
GUIStyle  style,
params GUILayoutOption[]  options 
)
static

This toggle does not return the new state but rather if the state has changed (true) or not (false)

static bool plyCommonEditor.plyEdGUI.ToggleButton ( Rect  r,
bool  active,
GUIContent  label,
GUIStyle  style 
)
static

This toggle does not return the new state but rather if the state has changed (true) or not (false)

static void plyCommonEditor.plyEdGUI.UseSkin ( )
static

This should be the first call in OnGUI() to make sure the custom styles are loaded and ready for use.

Property Documentation

string plyCommonEditor.plyEdGUI.ResPath
staticget

Path to the resources folder. Default, if not moved, is 'Assets/plyoung/edRes/'