| Editor | ||
| Runtime | ||
| .gitignore | ||
| Editor.meta | ||
| LICENSE | ||
| LICENSE.meta | ||
| package.json | ||
| package.json.meta | ||
| README.md | ||
| README.md.meta | ||
| Runtime.meta | ||
Description
This module contains a large collection of attributes that can be added either to a field or method. These attributes have different categories and some can be combined to create the desired behaviour for the field or method.
Base
There are six different kinds of attributes:
- Access
- Modify access to drawer or value change (E.g. Hide/Show, Disable/Enable input)
- Pre-drawer
- Modify
SerializedPropertyorGUIContentlabel before drawing begins
- Modify
- Drawer
- Custom drawing of the field/method
- Value
- Modify value before setting final result (E.g. clamp value)
- Validate
- Validate field (if invalid, draws as red)
- Decorator
- Adds additional information or styling to a field/method (E.g. Header displays a title/category to fields after attribute)
Access
List of all available access attributes:
Disable- Disables input to field
DisableField- Disables input to field given value of another field
DisableFieldInPlayMode- Disables input to field, when in play mode
DisableMethod- Disables input to method (button) given value of another field
DisableMethodInPlayMode- Disables input to method (button), when in play mode
EnableField- Enable input to field given value of another field
EnableFieldInPlayMode- Enable input to field, when in play mode
EnableMethod- Enable input to method (button) given value of another field
EnableMethodInPlayMode- Enable input to method (button), when in play mode
HideField- Hide field given value of another field
HideInNormalInspector- Hide field, if inspector is set to normal mode
HideMethod- Hide method (button) given value of another field
ShowField- Show field given value of another field
ShowMethod- Show method (button) given value of another field
Pre-drawer
List of all available pre-drawer attributes:
FieldLabelFrom- Sets GUIContent label for
SerializedPropertyto value from another field
- Sets GUIContent label for
FieldLabelFromEnum- Sets GUIContent label for
SerializedPropertyto enum name value of array index in parent field
- Sets GUIContent label for
FieldLabelFromType- Sets GUIContent label for
SerializedPropertyto value type from another field
- Sets GUIContent label for
FieldLabelFromToString- Sets GUIContent label for
SerializedPropertyto values ToString-method
- Sets GUIContent label for
HideLabel- Sets GUIContent label for
SerializedPropertyto empty string
- Sets GUIContent label for
Drawer
List of all available drawer attributes:
EnumFlag- Adds popup with enum type provided and allows for selecting values as flags (Requirement: Enum must have flag values)
FilePath- Adds file window and selected file is converted to string path
FolderPath- Adds folder window and selected folder is converted to string path
IntToAnimatorParameter- Adds popup with all animator parameter names provided by animator field and converts to hash id
IntToEnum- Adds a popup with enum type provided and converts it to an integer
IntToLayer- Adds a popup with a single layer selection and converts it to an integer
IntToLayerMask- Adds a popup with a multiple layer selection and converts it to an integer
MethodButton- Adds a button in the inspector that invokes the method (Requirement: No arguments)
Naming- Adds button to apply naming scheme to string value
- Types: Camel, Pascal, Snake, Snake (All caps), Kebab, Kebab (All caps)
OpenPropertyEditor- Adds a button to open a property window, if object reference is not null and either a
ScriptableObjectorComponent - Note:
OpenPropertyEditorandReadableScriptableObjectcurrently doesn't support each other
- Adds a button to open a property window, if object reference is not null and either a
Percentage- Convert float value to percentage and back again (1% = 0.01f)
PopupFromConst- Adds popup with all const fields of type string in provided type
PopupFromScriptableObjectType- Adds popup with all
ScriptableObjects from field or provided type
- Adds popup with all
QuaternionToEuler- Converts quaternion value to Euler angles and back again
ReadableScriptableObject- Creates an inline editor in the inspector window, so you can edit
ScriptableObjectswithout finding the object first
- Creates an inline editor in the inspector window, so you can edit
SceneDropdown- Adds a popup with all scenes in EditorBuildSettings scenes
SerializeReferenceTo- Adds a popup for
SerializeReferencefields with types inheriting from assigned type or field type
- Adds a popup for
SingleSelectionFlag- Adds popup, where only a single value from the flag can be selected
Slider- Adds a min & max slider and clamps value (Requirement:
MinValueandMaxValue)
- Adds a min & max slider and clamps value (Requirement:
StringToAnimatorParameter- Adds popup with all animator parameter names provided by animator field specified
StringToField- Adds button to open window to find all fields on object of provided type and sets string with selected field name
StringToType- Adds button to open window to find all types assignable from provided type and sets string with selected type name
Tag- Adds popup with all tag values for field of type string
UrlGoTo- Adds a button to the field that calls
Application.OpenUrlwith string value
- Adds a button to the field that calls
Value
List of all value attributes:
ArrayIndex- Clamps value between other fields array size
[0;size[
- Clamps value between other fields array size
AssetsOnly- If value is not an asset it will be set to null
AssignAssetIfNull- If value is null will assign first asset found using AssetDatabase.FindAssets
AssignComponentIfNull- If value is null will either use field or custom type to get from self or children
LargerThanField- If value is greater than other fields value, then set value to other fields value
MaxValue- If value is greater than max value, then set value to max value
MinValue- If value is less than min value, then set value to min value
SceneObjectsOnly- If value is an asset it will be set to null
SmallerThanField- If value is less than other fields value, then set value to other fields value
Validate
List of all validate attributes:
NotNullField- Checks if field is null
Decorators
List of all decorator attributes:
HorizontalLine- Draws a horizontal line above the field
MethodHeader- Draws a header/title/category text above the method (button)
Show Hidden Fields
To allow fields hidden from inspector either by NonSerialized or HideInInspector add the following to the class:
EnableShowHiddenFields- Enables an additional search to find any "hidden" fields and draw them below
DefaultInspector
- Enables an additional search to find any "hidden" fields and draw them below
ShowHiddenField- Optional attribute for fields, if
EnableShowHiddenFieldshas parametertrue
- Optional attribute for fields, if
Handles
List of all handle attributes:
BoxHandle- Resize a box shaped value, like Vector3
- Optional: Provide a
fieldPositionand/orfieldRotationfor handles to position and rotate
CircleHandle- Resize a circle shaped value, like float
- Optional: Provide a
fieldPositionfor handle to position
LabelHandle- Write text or field values
- Optional: Provide a
fieldPositionand/orfieldRotationfor handles to position and rotate
PositionHandle- Position handle with option to set number of axis visible (X, Y, Z)
RectangleHandle- Resize a rectangle shaped value, like Vector2
- Optional: Provide a
fieldPositionand/orfieldRotationfor handles to position and rotate
RotationHandle- Rotation handle for world or self-spaced rotation
- Optional: Provide a
fieldPositionfor handle to position
SphereHandle- Resize a sphere shaped value, like float
- Optional: Provide a
fieldPositionand/orfieldRotationfor handles to position and rotate