Highroad Engine v1.3
|
A component to handle switches More...
Public Member Functions | |
virtual void | InitializeState () |
virtual void | SetTrue () |
virtual void | SetFalse () |
virtual void | ToggleState () |
Use this method to go from one state to the other More... | |
Public Member Functions inherited from MoreMountains.Tools.MMTouchButton | |
virtual void | OnPointerDown (PointerEventData data) |
Triggers the bound pointer down action More... | |
virtual void | OnPointerUp (PointerEventData data) |
Triggers the bound pointer up action More... | |
virtual void | OnPointerPressed () |
Triggers the bound pointer pressed action More... | |
virtual void | OnPointerEnter (PointerEventData data) |
Triggers the bound pointer enter action when touch enters zone More... | |
virtual void | OnPointerExit (PointerEventData data) |
Triggers the bound pointer exit action when touch is out of zone More... | |
virtual void | DisableButton () |
virtual void | EnableButton () |
virtual void | OnSubmit (BaseEventData eventData) |
Public Attributes | |
MMDebugMenuSpriteReplace | SwitchKnob |
a SpriteReplace to represent the switch knob More... | |
bool | SwitchState |
the possible states of the switch More... | |
bool | InitialState = false |
the state the switch should start in More... | |
UnityEvent | OnSwitchOn |
the methods to call when the switch is turned on More... | |
UnityEvent | OnSwitchOff |
the methods to call when the switch is turned off More... | |
UnityEvent< bool > | OnSwitchToggle |
the methods to call when the switch is turned off More... | |
Public Attributes inherited from MoreMountains.Tools.MMTouchButton | |
bool | Interactable = true |
whether or not this button can be interacted with More... | |
UnityEvent | ButtonPressedFirstTime |
The method(s) to call when the button gets pressed down. More... | |
UnityEvent | ButtonReleased |
The method(s) to call when the button gets released. More... | |
UnityEvent | ButtonPressed |
The method(s) to call while the button is being pressed. More... | |
Sprite | DisabledSprite |
bool | DisabledChangeColor = false |
Color | DisabledColor = Color.white |
Sprite | PressedSprite |
bool | PressedChangeColor = false |
Color | PressedColor = Color.white |
Sprite | HighlightedSprite |
bool | HighlightedChangeColor = false |
Color | HighlightedColor = Color.white |
float | PressedOpacity = 1f |
the new opacity to apply to the canvas group when the button is pressed More... | |
float | IdleOpacity = 1f |
float | DisabledOpacity = 1f |
float | PressedFirstTimeDelay = 0f |
float | ReleasedDelay = 0f |
float | BufferDuration = 0f |
Animator | Animator |
string | IdleAnimationParameterName = "Idle" |
string | DisabledAnimationParameterName = "Disabled" |
string | PressedAnimationParameterName = "Pressed" |
bool | MouseMode = false |
If you set this to true, you'll need to actually press the button for it to be triggered, otherwise a simple hover will trigger it (better for touch input). More... | |
Protected Member Functions | |
override void | Initialization () |
On init, we set our current switch state More... | |
Protected Member Functions inherited from MoreMountains.Tools.MMTouchButton | |
virtual void | Awake () |
On Start, we get our canvasgroup and set our initial alpha More... | |
virtual void | Update () |
Every frame, if the touch zone is pressed, we trigger the OnPointerPressed method, to detect continuous press More... | |
virtual void | LateUpdate () |
At the end of every frame, we change our button's state if needed More... | |
virtual void | InvokePressedFirstTime () |
virtual void | InvokeReleased () |
virtual void | ResetButton () |
Resets the button's state and opacity More... | |
virtual void | OnEnable () |
OnEnable, we reset our button state More... | |
virtual void | SetOpacity (float newOpacity) |
virtual void | UpdateAnimatorStates () |
Additional Inherited Members | |
Public Types inherited from MoreMountains.Tools.MMTouchButton | |
enum | ButtonStates { Off , ButtonDown , ButtonPressed , ButtonUp , Disabled } |
Protected Attributes inherited from MoreMountains.Tools.MMTouchButton | |
bool | _zonePressed = false |
CanvasGroup | _canvasGroup |
float | _initialOpacity |
Animator | _animator |
Image | _image |
Sprite | _initialSprite |
Color | _initialColor |
float | _lastClickTimestamp = 0f |
Selectable | _selectable |
Properties inherited from MoreMountains.Tools.MMTouchButton | |
bool | ReturnToInitialSpriteAutomatically [getset] |
ButtonStates | CurrentState [getprotected set] |
the current state of the button (off, down, pressed or up) More... | |
Events inherited from MoreMountains.Tools.MMTouchButton | |
System.Action< PointerEventData.FramePressState, PointerEventData > | ButtonStateChange |
A component to handle switches
|
protectedvirtual |
On init, we set our current switch state
Reimplemented from MoreMountains.Tools.MMTouchButton.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Use this method to go from one state to the other
bool MoreMountains.Tools.MMDebugMenuSwitch.InitialState = false |
the state the switch should start in
UnityEvent MoreMountains.Tools.MMDebugMenuSwitch.OnSwitchOff |
the methods to call when the switch is turned off
UnityEvent MoreMountains.Tools.MMDebugMenuSwitch.OnSwitchOn |
the methods to call when the switch is turned on
UnityEvent<bool> MoreMountains.Tools.MMDebugMenuSwitch.OnSwitchToggle |
the methods to call when the switch is turned off
MMDebugMenuSpriteReplace MoreMountains.Tools.MMDebugMenuSwitch.SwitchKnob |
a SpriteReplace to represent the switch knob
bool MoreMountains.Tools.MMDebugMenuSwitch.SwitchState |
the possible states of the switch