From 492b882a517de62e52ac598521eab3371bd31b3c Mon Sep 17 00:00:00 2001 From: Anders Ejlersen Date: Sat, 4 Dec 2021 14:13:57 +0100 Subject: [PATCH] Added readme --- README.md | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md.meta | 7 +++ 2 files changed, 138 insertions(+) create mode 100644 README.md create mode 100644 README.md.meta diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9af063 --- /dev/null +++ b/README.md @@ -0,0 +1,131 @@ +# 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 five different kinds of attributes: + +* Access + * Modify access to drawer or value change (E.g. Hide/Show, Disable/Enable input) +* Pre-drawer + * Modify `SerializedProperty` or `GUIContent` label before drawing begins +* Drawer + * Custom drawing of the field/method +* Value + * Modify value before setting final result (E.g. clamp value) +* 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 SerializedProperty to value from another field + + +## 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 layers 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) +* `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 +* `QuaternionToEuler` + * Converts quaternion value to Euler angles and back again +* `SceneDropdown` + * Adds a popup with all scenes in EditorBuildSettings scenes +* `Slider` + * Adds a min & max slider and clamps value (Requirement: MinValue and MaxValue) +* `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.OpenUrl with string value + + +## Value + +List of all value attributes: + +* `ArrayIndex` + * Clamps value between other fields array size `[0;size[` +* `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 +* `SmallerThanField` + * If value is less than other fields value, then set value to other fields value + + +## 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) \ No newline at end of file diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..e0657d7 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7c9f62def88a4a64587d01cd982db7c8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: