Script documentation
Button.cs in TinyGiantStudio.Text namespace
If anything except method names starts with a capital letter, it's a property. Read the UI States section to understand what the terms like "press complete" mean in the asset.
Utility
Variable
Methods
SelectButton ()
This calls for all the required methods for selecting it. Visual, Module, Event, and if required, list events.
UnselectButton ()
This calls for all the required methods for unselecting it. Visual, Module, Event.
PressButton ()
This calls for all the required methods for selecting it. Visual, Module, Event, and if required, list events. Used everywhere except list.
PressButtonDontCallList ()
Same as PressButton except, it doesn't call list. Used by list to avoid recursion.
ButtonBeingPressed ()
PressCompleted ()
Uninteractable ()
Call this to set the button as Uninteractable
Interactable ()
Call this to set the button as Interactable
UnityEvents
unselectEvent
UnityEvent
This is the state that appears when a UI element enters the normal state from selected.
selectedEvent
UnityEvent
Mouse hover on the item or selected item via keyboard/controller in a list.
beingPressedEvent
UnityEvent
While the mouse/keyboard/controller button is pressed down or touch held down, the module or event is constantly called.
pressCompleteEvent
UnityEvent
When the user releases the key. In other words, the frame when the button/key or touch being pressed is complete.
Style
Variables
useStyles
bool
NormalTextSize
Vector3
NormalTextMaterial
Material
NormalBackgroundMaterial
Material
useSelectedVisual
bool
SelectedTextSize
Vector3
SelectedTextMaterial
Material
SelectedBackgroundMaterial
Material
usePressedVisual
bool
PressedTextSize
Vector3
PressedTextMaterial
Material
PressedBackgroundMaterial
Material
holdPressedVisualFor
float
UseDisabledVisual
bool
DisabledTextSize
Vector3
DisabledTextMaterial
DisabledBackgroundMaterial
Methods
UpdateStyle ()
UnselectedButtonVisualUpdate ()
SelectedButtonVisualUpdate ()
PressButtonVisualUpdate ()
DisabledButtonVisualUpdate ()
Module
useModules
bool
If set to false, disables all modules from this button. Modules are called when entering a style for the first time.
applyUnSelectedModuleContainers
bool
applySelectedModuleContainers
bool
applyBeingPressedModuleContainers
bool
applyPressCompleteModuleContainers
bool
Methods
UnselectButtonModuleUpdate ()
SelectedButtonModuleUpdate ()
BeingPressedButtonModuleUpdate ()
PressCompleteButtonModuleUpdate ()
EmptyEffect (List <ModuleContainer> moduleList, Module module = null)
Version History
v4.0.3 (June 2, 2023)
Renamed "unSelect" to "unSelected" for consistency with the rest of the asset.
onUnselecttounselectEventunSelectModuleContainerstounSelectedModuleContainersapplyUnSelectModuleContainerstoapplyUnSelectedModuleContainers
Renamed "onSelect" to "selected" for code consistency with the rest of the asset.
onSelecttoselectedEventonSelectModuleContainerstoselectedModuleContainersapplyOnSelectModuleContainerstoapplySelectModuleContainers
Renamed "onPress" to "beingPressed" for clarity about the fact that this is called constantly while the UI element is being pressed.
whileBeingClickedtobeingPressedEventonPressModuleContainerstobeingPressedModuleContainersapplyOnPressModuleContainerstoapplyBeingPressedModuleContainersButtonBeingPressedModuleUpdate to
Renamed "onClick" to "pressComplete" for clarity about what it does.
onClicktopressCompleteEventonClickModuleContainerstopressCompleteModuleContainersapplyOnClickModuleContainerstoapplyPressCompleteModuleContainersMethod
PressedButtonClickStopped()toPressCompleted()Method
OnClickButtonModuleUpdate()toPressCompleteButtonModuleUpdate ()
OnPressButtonModuleUpdate to ButtonBeingPressedModuleUpdate renamed to better clarify what it does.
Last updated
Was this helpful?