Contains extensions to EditorGUI for drawing custom properties.
More...
|
| static void | ValidatedObjectField (Rect position, SerializedProperty property, Type objType, GUIContent label, GUIStyle style, IObjectReferenceFieldAssignmentValidator validator) |
| | Draw an object field with a custom validator applied. More...
|
| |
| static void | ObjectFieldWithInterfaces (Rect position, SerializedProperty property, Type objType, GUIContent label, GUIStyle style, IReadOnlyList< Type > interfaces) |
| | Draw an object field, ensuring that any assigned value implements a list of interfaces. More...
|
| |
| static void | CreateNewInstanceDropDown (Type requiredType, Rect buttonRect, IReadOnlyList< Type > interfaces, Action< Type > createAction) |
| | Draw a button which, when pressed, will show a dropdown of all types that can be assigned to the given property. When the user clicks one of the options, their supplied callback will be triggered. More...
|
| |
| static void | AssetDropdown (SerializedProperty property, Type type, Rect buttonRect, GUIContent content, IReadOnlyList< Type > interfaces=null) |
| | Draw a dropdown for selecting an asset to assign to a property. More...
|
| |
Contains extensions to EditorGUI for drawing custom properties.
◆ AssetDropdown()
| static void Infohazard.Core.Editor.CoreDrawers.AssetDropdown |
( |
SerializedProperty |
property, |
|
|
Type |
type, |
|
|
Rect |
buttonRect, |
|
|
GUIContent |
content, |
|
|
IReadOnlyList< Type > |
interfaces = null |
|
) |
| |
|
static |
Draw a dropdown for selecting an asset to assign to a property.
- Parameters
-
| property | The property that will be assigned. |
| type | Type of required object. |
| buttonRect | Rect in which to show the button. |
| content | Content to show in the button. |
| interfaces | Interfaces that the object must implement. |
◆ CreateNewInstanceDropDown()
| static void Infohazard.Core.Editor.CoreDrawers.CreateNewInstanceDropDown |
( |
Type |
requiredType, |
|
|
Rect |
buttonRect, |
|
|
IReadOnlyList< Type > |
interfaces, |
|
|
Action< Type > |
createAction |
|
) |
| |
|
static |
Draw a button which, when pressed, will show a dropdown of all types that can be assigned to the given property. When the user clicks one of the options, their supplied callback will be triggered.
- Parameters
-
| requiredType | Type of required object. |
| buttonRect | Rect in which to show the button. |
| interfaces | Interfaces that the object must implement. |
| createAction | Action to invoke when the user chooses a type. |
◆ ObjectFieldWithInterfaces()
| static void Infohazard.Core.Editor.CoreDrawers.ObjectFieldWithInterfaces |
( |
Rect |
position, |
|
|
SerializedProperty |
property, |
|
|
Type |
objType, |
|
|
GUIContent |
label, |
|
|
GUIStyle |
style, |
|
|
IReadOnlyList< Type > |
interfaces |
|
) |
| |
|
static |
Draw an object field, ensuring that any assigned value implements a list of interfaces.
- Parameters
-
| position | Position and size of the field. |
| property | Property being edited. |
| objType | Type of the field. |
| label | Label to display. |
| style | Style to use. |
| interfaces | Interfaces that must be implemented. |
◆ ValidatedObjectField()
| static void Infohazard.Core.Editor.CoreDrawers.ValidatedObjectField |
( |
Rect |
position, |
|
|
SerializedProperty |
property, |
|
|
Type |
objType, |
|
|
GUIContent |
label, |
|
|
GUIStyle |
style, |
|
|
IObjectReferenceFieldAssignmentValidator |
validator |
|
) |
| |
|
static |
Draw an object field with a custom validator applied.
- Parameters
-
| position | Position and size of the field. |
| property | Property being edited. |
| objType | Type of the field. |
| label | Label to display. |
| style | Style to use. |
| validator | Validator to apply. |
The documentation for this class was generated from the following file:
- Editor/Utility/CoreDrawers.cs