MoreEditorGUI¶
Namespace:
SideXP.Core.EditorOnly
Miscellaneous functions for drawing user interfaces in the editor.
Fields¶
ScriptProperty¶
SeparatorColor¶
DarkSeparatorColor¶
DefaultSeparatorSize¶
Properties¶
IconButtonStyle¶
The custom style used for buttons that just contains an icon.
TitleStyle¶
The custom style for titles.
Methods¶
DrawDefaultInspector(Object, string[])¶
Parameters
obj: The object of which you want to draw the inspector.
DrawDefaultInspector(Object, IEnumerable<string>, IEnumerable<string>)¶
public static void DrawDefaultInspector(Object obj, IEnumerable<string> ignoredProperties, IEnumerable<string> delveProperties)
Draws the default inspector of a given object, without the script property.
Parameters
obj: The object of which you want to draw the inspector.
DrawDefaultInspector(SerializedObject, string[])¶
public static void DrawDefaultInspector(SerializedObject serializedObj, params string[] ignoredProperties)
Draws the default inspector of a given object, without the script property.
Parameters
serializedObj: The serialized representation of the object of which you want to draw the inspector.
DrawDefaultInspector(SerializedObject, IEnumerable<string>, IEnumerable<string>)¶
public static void DrawDefaultInspector(SerializedObject serializedObj, IEnumerable<string> ignoredProperties, IEnumerable<string> delveProperties)
Draws the default inspector of a given object, without the script property.
Parameters
serializedObj: The serialized representation of the object of which you want to draw the inspector.ignoredProperties: The name of the properties that should not appear in the inspector.delveProperties: The name of the properties that should be "delved". Delved properties are skipped, but they child properties are still displayed. In the inspector, this will result in displaying the child properties without foldout field above to expand the parent.
Returns
Returns true if the property field has been drawn on GUI.
DrawPropertyField(SerializedProperty)¶
Draws the property field for the given property if it's not ignored.
Parameters
property: The property of which you want to draw the field, if applicable.
Returns
Returns true if the property field has been drawn on GUI.
DrawPropertyField(SerializedProperty, IEnumerable<string>, IEnumerable<string>)¶
public static bool DrawPropertyField(SerializedProperty property, IEnumerable<string> ignoredProperties, IEnumerable<string> delveProperties)
Draws the property field for the given property if it's not ignored.
Parameters
property: The property of which you want to draw the field, if applicable.ignoredProperties: The name of the properties that should not appear in the inspector.delveProperties: The name of the properties that should be "delved". Delved properties are skipped, but they child properties are still displayed. In the inspector, this will result in displaying the child properties without foldout field above to expand the parent.
Returns
Returns true if the property field has been drawn on GUI.
PropertyField(object, Rect, FieldInfo, GUIContent)¶
Draws a field in the inspector for a value that doesn't have a serialized representation.
Parameters
obj: The object that owns the field.position: Rectangle on the screen to use for the field.field: The reflection info about the field.label: The label of the field to draw on GUI.
Returns
Returns true if the value changed.
Remarks
Supported property types: - float - int - bool - string - enum - Object - Vector2 - Vector3 - Vector4 - Quaternion - Vector2Int - Vector3Int
PropertyField(object, Rect, FieldInfo, string)¶
Draws a field in the inspector for a value that doesn't have a serialized representation.
Parameters
obj: The object that owns the field.position: Rectangle on the screen to use for the field.field: The reflection info about the field.label: The label of the field to draw on GUI.
Returns
Returns true if the value changed.
Remarks
Supported property types: - float - int - bool - string - enum - Object - Vector2 - Vector3 - Vector4 - Quaternion - Vector2Int - Vector3Int
PropertyField(object, Rect, FieldInfo, bool)¶
public static bool PropertyField(object obj, Rect position, FieldInfo field, bool autoLabel = false)
Draws a field in the inspector for a value that doesn't have a serialized representation.
Parameters
autoLabel: If enabled, this function creates aGUIContentto use as label for the field, using the name of the field as text, and optionally the content of itsTooltipAttributeas tooltip.obj: The object that owns the field.position: Rectangle on the screen to use for the field.field: The reflection info about the field.
Returns
Returns true if the value changed.
Remarks
Supported property types: - float - int - bool - string - enum - Object - Vector2 - Vector3 - Vector4 - Quaternion - Vector2Int - Vector3Int
PropertyField(object, FieldInfo, GUIContent)¶
Draws a field in the inspector for a value that doesn't have a serialized representation.
Parameters
obj: The object that owns the field.field: The reflection info about the field.label: The label of the field to draw on GUI.
Returns
Returns true if the value changed.
Remarks
Uses layout GUI.
PropertyField(object, FieldInfo, string)¶
Remarks
Uses layout GUI.
PropertyField(object, FieldInfo, bool)¶
Remarks
Uses layout GUI.
FloatField(Rect, float, GUIContent, GUIStyle)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.style: OptionalGUIStyle.position: Rectangle on the screen to use for the field.label: The label of the field to draw on GUI.
Returns
The value entered by the user.
Remarks
Supported property types: - float - int - bool - string - enum - Object - Vector2 - Vector3 - Vector4 - Quaternion - Vector2Int - Vector3Int
FloatField(Rect, float, string, GUIStyle)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
FloatField(Rect, float)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.
Returns
The value entered by the user.
FloatField(float, GUIContent, GUIStyle)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
FloatField(float, string, GUIStyle)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
FloatField(float)¶
Makes a text field for entering floats.
Parameters
value: The value to edit.
Returns
The value entered by the user.
IntField(Rect, int, GUIContent, GUIStyle)¶
Makes a text field for entering integers.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
IntField(Rect, int, string, GUIStyle)¶
Makes a text field for entering integers.
IntField(Rect, int)¶
Makes a text field for entering integers.
IntField(int, GUIContent, GUIStyle)¶
Makes a text field for entering integers.
IntField(int, string, GUIStyle)¶
Inherited documentation.
IntField(int)¶
Inherited documentation.
ToggleField(Rect, bool, GUIContent, GUIStyle)¶
Makes a toggle.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
ToggleField(Rect, bool, string, GUIStyle)¶
Makes a toggle.
ToggleField(Rect, bool)¶
Makes a toggle.
ToggleField(bool, GUIContent, GUIStyle)¶
Makes a toggle.
ToggleField(bool, string, GUIStyle)¶
Inherited documentation.
ToggleField(bool)¶
Inherited documentation.
TextField(Rect, string, GUIContent, GUIStyle)¶
public static string TextField(Rect position, string value, GUIContent label, GUIStyle style = null)
Makes a text field.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
TextField(Rect, string, string, GUIStyle)¶
Makes a text field.
TextField(Rect, string)¶
Makes a text field.
TextField(string, GUIContent, GUIStyle)¶
Makes a text field.
TextField(string, string, GUIStyle)¶
Inherited documentation.
TextField(string)¶
Inherited documentation.
EnumPopupField(Rect, Enum, GUIContent, GUIStyle)¶
public static Enum EnumPopupField(Rect position, Enum value, GUIContent label, GUIStyle style = null)
Makes an enum popup selection field.
Parameters
value: The value to edit.style: OptionalGUIStyle.
Returns
The value entered by the user.
EnumPopupField(Rect, Enum, string, GUIStyle)¶
Makes an enum popup selection field.
EnumPopupField(Rect, Enum)¶
Makes an enum popup selection field.
EnumPopupField(Enum, GUIContent, GUIStyle)¶
Makes an enum popup selection field.
EnumPopupField(Enum, string, GUIStyle)¶
Inherited documentation.
EnumPopupField(Enum)¶
Inherited documentation.
ObjectField(Rect, Object, Type, GUIContent, bool)¶
public static Object ObjectField(Rect position, Object value, Type type, GUIContent label, bool allowSceneObjects = true)
Makes an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
Parameters
type: The type of the objects that can be assigned.value: The value to edit.
Returns
The value entered by the user.
ObjectField(Rect, Object, Type, string, bool)¶
public static Object ObjectField(Rect position, Object value, Type type, string label, bool allowSceneObjects = true)
Makes an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
Parameters
type: The type of the objects that can be assigned.
ObjectField(Rect, Object, Type, bool)¶
public static Object ObjectField(Rect position, Object value, Type type, bool allowSceneObjects = true)
Makes an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
Parameters
type: The type of the objects that can be assigned.
ObjectField(Object, Type, GUIContent, bool)¶
public static Object ObjectField(Object value, Type type, GUIContent label, bool allowSceneObjects = true)
Makes an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
Parameters
type: The type of the objects that can be assigned.
ObjectField(Object, Type, string, bool)¶
public static Object ObjectField(Object value, Type type, string label, bool allowSceneObjects = true)
Inherited documentation.
ObjectField(Object, Type, bool)¶
Inherited documentation.
Vector2Field(Rect, Vector2, GUIContent)¶
Makes an X and Y field for entering a Vector2.
Parameters
value: The value to edit.
Returns
The value entered by the user.
Vector2Field(Rect, Vector2, string)¶
Makes an X and Y field for entering a Vector2.
Vector2Field(Rect, Vector2)¶
Makes an X and Y field for entering a Vector2.
Vector2Field(Vector2, GUIContent)¶
Makes an X and Y field for entering a Vector2.
Vector2Field(Vector2, string)¶
Inherited documentation.
Vector2Field(Vector2)¶
Inherited documentation.
Vector3Field(Rect, Vector3, GUIContent)¶
Makes an X, Y and Z field for entering a Vector3.
Parameters
value: The value to edit.
Returns
The value entered by the user.
Vector3Field(Rect, Vector3, string)¶
Makes an X, Y and Z field for entering a Vector3.
Vector3Field(Rect, Vector3)¶
Makes an X, Y and Z field for entering a Vector3.
Vector3Field(Vector3, GUIContent)¶
Makes an X, Y and Z field for entering a Vector3.
Vector3Field(Vector3, string)¶
Inherited documentation.
Vector3Field(Vector3)¶
Inherited documentation.
Vector4Field(Rect, Vector4, GUIContent)¶
Makes an X, Y, Z and W field for entering a Vector4.
Parameters
value: The value to edit.
Returns
The value entered by the user.
Vector4Field(Rect, Vector4, string)¶
Makes an X, Y, Z and W field for entering a Vector4.
Vector4Field(Rect, Vector4)¶
Makes an X, Y, Z and W field for entering a Vector4.
Vector4Field(Vector4, GUIContent)¶
Makes an X, Y, Z and W field for entering a Vector4.
Vector4Field(Vector4, string)¶
Inherited documentation.
Vector4Field(Vector4)¶
Inherited documentation.
QuaternionField(Rect, Quaternion, GUIContent)¶
Makes an X, Y and Z field for entering a Quaternion as euler angles.
Parameters
value: The value to edit.
Returns
The value entered by the user.
QuaternionField(Rect, Quaternion, string)¶
Makes an X, Y and Z field for entering a Quaternion as euler angles.
QuaternionField(Rect, Quaternion)¶
Makes an X, Y and Z field for entering a Quaternion as euler angles.
QuaternionField(Quaternion, GUIContent)¶
Makes an X, Y and Z field for entering a Quaternion as euler angles.
QuaternionField(Quaternion, string)¶
Inherited documentation.
QuaternionField(Quaternion)¶
Inherited documentation.
Vector2IntField(Rect, Vector2Int, GUIContent)¶
Makes an X and Y field for entering a Vector2Int.
Parameters
value: The value to edit.
Returns
The value entered by the user.
Vector2IntField(Rect, Vector2Int, string)¶
Makes an X and Y field for entering a Vector2Int.
Vector2IntField(Rect, Vector2Int)¶
Makes an X and Y field for entering a Vector2Int.
Vector2IntField(Vector2Int, GUIContent)¶
Makes an X and Y field for entering a Vector2Int.
Vector2IntField(Vector2Int, string)¶
Inherited documentation.
Vector2IntField(Vector2Int)¶
Inherited documentation.
Vector3IntField(Rect, Vector3Int, GUIContent)¶
Makes an X, Y and Z field for entering a Vector3Int.
Parameters
value: The value to edit.
Returns
The value entered by the user.
Vector3IntField(Rect, Vector3Int, string)¶
Makes an X, Y and Z field for entering a Vector3Int.
Vector3IntField(Rect, Vector3Int)¶
Makes an X, Y and Z field for entering a Vector3Int.
Vector3IntField(Vector3Int, GUIContent)¶
Makes an X, Y and Z field for entering a Vector3Int.
Vector3IntField(Vector3Int, string)¶
Inherited documentation.
Vector3IntField(Vector3Int)¶
Inherited documentation.
AssetNameField(Object, GUILayoutOption[])¶
Parameters
options: Options for drawing the field.
AssetNameField(string, Object, GUILayoutOption[])¶
Parameters
options: Options for drawing the field.
AssetNameField(GUIContent, Object, GUILayoutOption[])¶
Draws a delayed text field
Parameters
options: Options for drawing the field.label: The label of the field. If not provided, only the field is displayed.asset: The asset to rename.
Returns
Returns true if the name has been changed.
AssetNameField(Rect, Object)¶
Draws a delayed text field
Parameters
position: The available area for drawing the field.asset: The asset to rename.
Returns
Returns true if the name has been changed.
AssetNameField(Rect, string, Object)¶
Draws a delayed text field
Parameters
position: The available area for drawing the field.label: The label of the field. If not provided, only the field is displayed.asset: The asset to rename.
Returns
Returns true if the name has been changed.
AssetNameField(Rect, GUIContent, Object)¶
Draws a delayed text field
Parameters
position: The available area for drawing the field.label: The label of the field. If not provided, only the field is displayed.asset: The asset to rename.
Returns
Returns true if the name has been changed.
PaginationField(Pagination)¶
Draws a field to edit the given pagination value.
Parameters
pagination: The pagination value to edit.
PaginationField(string, Pagination)¶
Draws a field to edit the given pagination value.
Parameters
label: The label of the field.pagination: The pagination value to edit.
PaginationField(GUIContent, Pagination)¶
Draws a field to edit the given pagination value.
Parameters
label: The label of the field.pagination: The pagination value to edit.
PaginationField(Rect, Pagination)¶
Draws a field to edit the given pagination value.
Parameters
position: The position and size of the field.pagination: The pagination value to edit.
PaginationField(Rect, string, Pagination)¶
Draws a field to edit the given pagination value.
Parameters
label: The label of the field.position: The position and size of the field.pagination: The pagination value to edit.
PaginationField(Rect, GUIContent, Pagination)¶
Draws a field to edit the given pagination value.
Parameters
label: The label of the field.position: The position and size of the field.pagination: The pagination value to edit.
FolderPathField(Rect, GUIContent, string, string, string, bool)¶
public static string FolderPathField(Rect position, GUIContent label, string path, string title, string defaultName, bool allowExternal = false)
Draws a field in the inspector to select a directory.
Parameters
position: The position of the field on the GUI.label: The label of the field.path: The current path value.title: The title of the "select folder" panel.defaultName: The default name of the folder to select.allowExternal: By default, this function only allow user to select a path to a directory inside the current project. If enabled, the user can select a path outside the current project. Note that the path won't be converted into a relative path if it's outside of the project.
Returns
Returns the selected directory path.
FolderPathField(Rect, string, string, string, string, bool)¶
public static string FolderPathField(Rect position, string label, string path, string title, string defaultName, bool allowExternal = false)
Draws a field in the inspector to select a directory.
Parameters
position: The position of the field on the GUI.label: The label of the field.path: The current path value.title: The title of the "select folder" panel.defaultName: The default name of the folder to select.allowExternal: By default, this function only allow user to select a path to a directory inside the current project. If enabled, the user can select a path outside the current project. Note that the path won't be converted into a relative path if it's outside of the project.
Returns
Returns the selected directory path.
FolderPathField(GUIContent, string, string, string, bool)¶
public static string FolderPathField(GUIContent label, string path, string title, string defaultName, bool allowExternal = false)
Draws a field in the inspector to select a directory.
Parameters
label: The label of the field.path: The current path value.title: The title of the "select folder" panel.defaultName: The default name of the folder to select.allowExternal: By default, this function only allow user to select a path to a directory inside the current project. If enabled, the user can select a path outside the current project. Note that the path won't be converted into a relative path if it's outside of the project.
Returns
Returns the selected directory path.
FolderPathField(string, string, string, string, bool)¶
public static string FolderPathField(string label, string path, string title, string defaultName, bool allowExternal = false)
Draws a field in the inspector to select a directory.
Parameters
label: The label of the field.path: The current path value.title: The title of the "select folder" panel.defaultName: The default name of the folder to select.allowExternal: By default, this function only allow user to select a path to a directory inside the current project. If enabled, the user can select a path outside the current project. Note that the path won't be converted into a relative path if it's outside of the project.
Returns
Returns the selected directory path.
HorizontalSeparator(bool, bool)¶
Parameters
dark: If enabled, uses the dark separator color.
HorizontalSeparator(float, bool, bool)¶
Draws an horizontal line.
Parameters
dark: If enabled, uses the dark separator color.size: The height of the separator.wide: If enabled, the separator will use the full view width. This is designed to draw a separator that doesn't use the margins in the inspector window.
HorizontalSeparator(float, Color, bool)¶
Draws an horizontal line.
Parameters
size: The height of the separator.color: The color of the separator.wide: If enabled, the separator will use the full view width. This is designed to draw a separator that doesn't use the margins in the inspector window.
VerticalSeparator(float, Color)¶
Draws a vertical line.
Parameters
size: The width of the separator.color: The color of the separator.
VerticalSeparator(float)¶
Draws a vertical line.
Parameters
size: The width of the separator.
VerticalSeparator()¶
Draws a vertical line.