Learn / Documentation / UIToggle

Description

The UIToggle is a core component in the DoozyUI system. It contains all the logic needed for a toggle to work and behave in various ways in order to create complex UI interactions.

Component Details

Gesture Listener
Gesture Listener
  • Settings – Opens the Control Panel at the Settings tab

  • Manual – Link to the manual page for this component

  • YouTube – Link to the quick video tutorial for this component

  • Debug Mode – Enables relevant debug messages to be printed to the console

  • Create Parent and Center Pivot – Creates a new GameObject with the same RectTransform settings as the UIToggle, then reparents the UIToggle to the newly created GameObject

  • Is On – Toggles the UIToggle’s on/off state

  • Allow Multiple Clicks – If enabled, this toggle can be spam clicked and it won’t get disabled. Else, after each click, this toggle will get disabled for DisableButtonBetweenClicksInterval value

  • Disable Button Interval – If AllowMultipleClicks is disabled, then this interval determines for how long this toggle gets disabled after each click

  • Deselect Button After Click – If enabled, after this toggle has been clicked it will get automatically deselected

  • Input Mode – Allows the toggle to react to keys or virtual buttons (only when selected). See InputData

  • OnPointerEnter – Behavior when the pointer enters (hovers in) over the toggle’s area

  • OnPointerExit – Behavior when the pointer exits (hovers out) the toggle’s area (happens only after OnPointerEnter)

  • OnClick – Behavior when the pointer performs a click over the toggle

  • OnSelected – Behavior when the toggle gets selected

  • OnDeselected – Behavior when the toggle gets deselected

  • Toggle Progressor – Reference to a Progressor that allows animating anything (texts, images, animations…) when this UIToggle has been toggled

  • OnValueChangedBoolEvent executed when the value of the toggle has changed

Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener

OnPointerEnter Behavior

  • Select Button – Determines if the button should get selected after this behavior has been triggered

  • Disable Interval – Time interval after this behavior has been fired while it cannot be fired again

  • New Preset – Create a new preset with the current animation settings

  • Load Preset – Load the currently selected preset

  • Delete Preset – Delete the currently selected preset

  • Preset Category – Preset category name

  • Preset Name – Preset name

  • Load selected preset at runtime – Determines if the selected preset should override at runtime the current editor settings or not

  • Animation – @[email protected] executed when the behavior is triggered

  • Toggle ONUIAction executed when the behavior is triggered and the toggle is on

  • Toggle OFF UIAction executed when the behavior is triggered and the toggle is off

  • Button Animation Type – Punch / State / Animator

  • Reset Animation Settings – Resets the current animation settings

Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener

OnPointerExit Behavior

  • Deselect Button – Determines if the button should get deselected after this behavior has been triggered

  • Disable Interval – Time interval after this behavior has been fired while it cannot be fired again

  • New Preset – Create a new preset with the current animation settings

  • Load Preset – Load the currently selected preset

  • Delete Preset – Delete the currently selected preset

  • Preset Category – Preset category name

  • Preset Name – Preset name

  • Load selected preset at runtime – Determines if the selected preset should override at runtime the current editor settings or not

  • Animation – @[email protected] executed when the behavior is triggered

  • Toggle ONUIAction executed when the behavior is triggered and the toggle is on

  • Toggle OFF UIAction executed when the behavior is triggered and the toggle is off

  • Button Animation Type – Punch / State / Animator

  • Reset Animation Settings – Resets the current animation settings

Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener

OnClick Behavior

  • Trigger events after animation – If enabled, all the events will get fired after the animation finished playing. This is useful if you want to be sure the user sees the button animation

  • New Preset – Create a new preset with the current animation settings

  • Load Preset – Load the currently selected preset

  • Delete Preset – Delete the currently selected preset

  • Preset Category – Preset category name

  • Preset Name – Preset name

  • Load selected preset at runtime – Determines if the selected preset should override at runtime the current editor settings or not

  • Animation – @[email protected] executed when the behavior is triggered

  • Toggle ONUIAction executed when the behavior is triggered and the toggle is on

  • Toggle OFF UIAction executed when the behavior is triggered and the toggle is off

  • Button Animation Type – Punch / State / Animator

  • Reset Animation Settings – Resets the current animation settings

Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener

OnSelected Behavior

  • New Preset – Create a new preset with the current animation settings

  • Load Preset – Load the currently selected preset

  • Delete Preset – Delete the currently selected preset

  • Preset Category – Preset category name

  • Preset Name – Preset name

  • Load selected preset at runtime – Determines if the selected preset should override at runtime the current editor settings or not

  • Animation – @[email protected] executed when the behavior is triggered

  • Toggle ONUIAction executed when the behavior is triggered and the toggle is on

  • Toggle OFF UIAction executed when the behavior is triggered and the toggle is off

  • Button Animation Type – Punch / State / Animator

  • Reset Animation Settings – Resets the current animation settings

Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener
Gesture Listener

OnDeselected Behavior

  • New Preset – Create a new preset with the current animation settings

  • Load Preset – Load the currently selected preset

  • Delete Preset – Delete the currently selected preset

  • Preset Category – Preset category name

  • Preset Name – Preset name

  • Load selected preset at runtime – Determines if the selected preset should override at runtime the current editor settings or not

  • Animation – @[email protected] executed when the behavior is triggered

  • Toggle ONUIAction executed when the behavior is triggered and the toggle is on

  • Toggle OFF UIAction executed when the behavior is triggered and the toggle is off

  • Button Animation Type – Punch / State / Animator

  • Reset Animation Settings – Resets the current animation settings