UITextAction - CodingDino/Dino-Unity-Toolkit GitHub Wiki
The UITextAction component changes the displayed text for one of Unity's built in UI Text components. The UITextAction component must be attached to a GameObject that has a Text component on it, and therefore must be in the UI (a child of a Canvas object).
This is an Action component, and therefore must be triggered by a separate Activator component. Actions, Activators, and Data make up the core system for the Dino Unity Toolkit.
Image: UITextAction set up to limit the number of decimal places displayed.
Image: UITextAction showing a countdown using TimerAction and FloatData.
Properties
Property: | Description: |
---|---|
Limit Float Decimals | Should we limit the display of decimals for float values? |
Num Decimals | Only used if Limit Float Decimals is set to true. Float values will only display this many decimal places. |
Actions
This component has several Action functions that can be triggered by Activators.
ActionSetTextString()
This action sets the attached Text component's displayed text to the string value supplied.
Parameter: | Description: |
---|---|
New Text | The new string value for the displayed text. |
ActionSetTextInt()
This action takes the int value supplied and converts it to a string, then displays it using the attached Text component.
Parameter: | Description: |
---|---|
New Text | The int value that will be converted to a string and displayed |
ActionSetTextFloat()
This action takes the float value supplied and converts it to a string, then displays it using the attached Text component. If Limit Float Decimals has been set to true, the float value will be simplified when being converted to a string, limiting the number of decimal places based on the setting for Num Decimals.
Parameter: | Description: |
---|---|
New Text | The float value that will be converted to a string and displayed |