Summary
[Editor-Conditional]
Causes a float field to display a suffix to indicate what kind of units the value represents as well as
displaying it as several different fields which convert the value between different units.
- Assembly
- Animancer
.dll - Namespace
- Animancer
.Units - Base Types
-
- PropertyAttribute
- Derived Types
graph BT
Type-->Base0["PropertyAttribute"]
Type["UnitsAttribute"]
class Type type-node
Derived0["SecondsAttribute"]-->Type
click Derived0 "/animancer/api/Animancer.Units/SecondsAttribute"
Derived1["MetersPerSecondPerSecondAttribute"]-->Type
click Derived1 "/animancer/api/Animancer.Units/MetersPerSecondPerSecondAttribute"
Derived2["AnimationSpeedAttribute"]-->Type
click Derived2 "/animancer/api/Animancer.Units/AnimationSpeedAttribute"
Derived3["AnimationTimeAttribute"]-->Type
click Derived3 "/animancer/api/Animancer.Units/AnimationTimeAttribute"
Derived4["MetersPerSecondAttribute"]-->Type
click Derived4 "/animancer/api/Animancer.Units/MetersPerSecondAttribute"
Derived5["MetersAttribute"]-->Type
click Derived5 "/animancer/api/Animancer.Units/MetersAttribute"
Derived6["MultiplierAttribute"]-->Type
click Derived6 "/animancer/api/Animancer.Units/MultiplierAttribute"
Derived7["DegreesAttribute"]-->Type
click Derived7 "/animancer/api/Animancer.Units/DegreesAttribute"
Derived8["PerSecondAttribute"]-->Type
click Derived8 "/animancer/api/Animancer.Units/PerSecondAttribute"
Derived9["DegreesPerSecondAttribute"]-->Type
click Derived9 "/animancer/api/Animancer.Units/DegreesPerSecondAttribute"
Syntax
[System.Diagnostics.Conditional(Strings.UnityEditor)]
public class UnitsAttribute : PropertyAttribute
Remarks
Documentation:
Units Attribute
Attributes
| Type | Description |
|---|---|
| ConditionalAttribute |
Constructors
| Name | Summary |
|---|---|
| UnitsAttribute |
Creates a new Animancer.Units.UnitsAttribute. |
| UnitsAttribute |
Creates a new Animancer.Units.UnitsAttribute. |
| UnitsAttribute |
Creates a new Animancer.Units.UnitsAttribute. |
Fields
| Name | Constant Value | Summary |
|---|---|---|
| Multipliers |
The multipliers to convert from the field's actual value to each unit type.
|
|
| Suffixes |
The unit suffix to display at the end of the value in each field.
|
|
| UnitIndex |
The index of the multiplier where the field stores its actual value.
|
Properties
| Name | Value | Summary |
|---|---|---|
| DefaultValue | float |
The value to display if the actual value is
System.Single.NaN. |
| DisabledText | string |
Optional text to display instead of the regular fields when the value is
System.Single.NaN. |
| IsOptional | bool |
Should the field have a toggle to set its value to
System.Single.NaN? |
| Rule | Validate |
The validation rule applied to the value.
|