Add this component to a GUI Image to have it act as a button. Bind pressed down, pressed continually and released actions to it from the inspector Handles mouse and multi touch
More...
|
System.Action< PointerEventData.FramePressState, PointerEventData > | ButtonStateChange |
|
Add this component to a GUI Image to have it act as a button. Bind pressed down, pressed continually and released actions to it from the inspector Handles mouse and multi touch
◆ ButtonStates
The different possible states for the button : Off (default idle state), ButtonDown (button pressed for the first time), ButtonPressed (button being pressed), ButtonUp (button being released), Disabled (unclickable but still present on screen) ButtonDown and ButtonUp will only last one frame, the others will last however long you press them / disable them / do nothing
Enumerator |
---|
Off | |
ButtonDown | |
ButtonPressed | |
ButtonUp | |
Disabled | |
◆ Awake()
virtual void MoreMountains.Tools.MMTouchButton.Awake |
( |
| ) |
|
|
protectedvirtual |
On Start, we get our canvasgroup and set our initial alpha
◆ DisableButton()
virtual void MoreMountains.Tools.MMTouchButton.DisableButton |
( |
| ) |
|
|
virtual |
◆ EnableButton()
virtual void MoreMountains.Tools.MMTouchButton.EnableButton |
( |
| ) |
|
|
virtual |
◆ Initialization()
virtual void MoreMountains.Tools.MMTouchButton.Initialization |
( |
| ) |
|
|
protectedvirtual |
◆ InvokePressedFirstTime()
virtual void MoreMountains.Tools.MMTouchButton.InvokePressedFirstTime |
( |
| ) |
|
|
protectedvirtual |
◆ InvokeReleased()
virtual void MoreMountains.Tools.MMTouchButton.InvokeReleased |
( |
| ) |
|
|
protectedvirtual |
◆ LateUpdate()
virtual void MoreMountains.Tools.MMTouchButton.LateUpdate |
( |
| ) |
|
|
protectedvirtual |
At the end of every frame, we change our button's state if needed
◆ OnEnable()
virtual void MoreMountains.Tools.MMTouchButton.OnEnable |
( |
| ) |
|
|
protectedvirtual |
OnEnable, we reset our button state
◆ OnPointerDown()
virtual void MoreMountains.Tools.MMTouchButton.OnPointerDown |
( |
PointerEventData |
data | ) |
|
|
virtual |
Triggers the bound pointer down action
◆ OnPointerEnter()
virtual void MoreMountains.Tools.MMTouchButton.OnPointerEnter |
( |
PointerEventData |
data | ) |
|
|
virtual |
Triggers the bound pointer enter action when touch enters zone
◆ OnPointerExit()
virtual void MoreMountains.Tools.MMTouchButton.OnPointerExit |
( |
PointerEventData |
data | ) |
|
|
virtual |
Triggers the bound pointer exit action when touch is out of zone
◆ OnPointerPressed()
virtual void MoreMountains.Tools.MMTouchButton.OnPointerPressed |
( |
| ) |
|
|
virtual |
Triggers the bound pointer pressed action
◆ OnPointerUp()
virtual void MoreMountains.Tools.MMTouchButton.OnPointerUp |
( |
PointerEventData |
data | ) |
|
|
virtual |
Triggers the bound pointer up action
◆ OnSubmit()
virtual void MoreMountains.Tools.MMTouchButton.OnSubmit |
( |
BaseEventData |
eventData | ) |
|
|
virtual |
◆ ResetButton()
virtual void MoreMountains.Tools.MMTouchButton.ResetButton |
( |
| ) |
|
|
protectedvirtual |
Resets the button's state and opacity
◆ SetOpacity()
virtual void MoreMountains.Tools.MMTouchButton.SetOpacity |
( |
float |
newOpacity | ) |
|
|
protectedvirtual |
◆ Update()
virtual void MoreMountains.Tools.MMTouchButton.Update |
( |
| ) |
|
|
protectedvirtual |
Every frame, if the touch zone is pressed, we trigger the OnPointerPressed method, to detect continuous press
◆ UpdateAnimatorStates()
virtual void MoreMountains.Tools.MMTouchButton.UpdateAnimatorStates |
( |
| ) |
|
|
protectedvirtual |
◆ _animator
Animator MoreMountains.Tools.MMTouchButton._animator |
|
protected |
◆ _canvasGroup
CanvasGroup MoreMountains.Tools.MMTouchButton._canvasGroup |
|
protected |
◆ _image
Image MoreMountains.Tools.MMTouchButton._image |
|
protected |
◆ _initialColor
Color MoreMountains.Tools.MMTouchButton._initialColor |
|
protected |
◆ _initialOpacity
float MoreMountains.Tools.MMTouchButton._initialOpacity |
|
protected |
◆ _initialSprite
Sprite MoreMountains.Tools.MMTouchButton._initialSprite |
|
protected |
◆ _lastClickTimestamp
float MoreMountains.Tools.MMTouchButton._lastClickTimestamp = 0f |
|
protected |
◆ _selectable
Selectable MoreMountains.Tools.MMTouchButton._selectable |
|
protected |
◆ _zonePressed
bool MoreMountains.Tools.MMTouchButton._zonePressed = false |
|
protected |
◆ Animator
Animator MoreMountains.Tools.MMTouchButton.Animator |
◆ BufferDuration
float MoreMountains.Tools.MMTouchButton.BufferDuration = 0f |
◆ ButtonPressed
UnityEvent MoreMountains.Tools.MMTouchButton.ButtonPressed |
The method(s) to call while the button is being pressed.
◆ ButtonPressedFirstTime
UnityEvent MoreMountains.Tools.MMTouchButton.ButtonPressedFirstTime |
The method(s) to call when the button gets pressed down.
◆ ButtonReleased
UnityEvent MoreMountains.Tools.MMTouchButton.ButtonReleased |
The method(s) to call when the button gets released.
◆ DisabledAnimationParameterName
string MoreMountains.Tools.MMTouchButton.DisabledAnimationParameterName = "Disabled" |
◆ DisabledChangeColor
bool MoreMountains.Tools.MMTouchButton.DisabledChangeColor = false |
◆ DisabledColor
Color MoreMountains.Tools.MMTouchButton.DisabledColor = Color.white |
◆ DisabledOpacity
float MoreMountains.Tools.MMTouchButton.DisabledOpacity = 1f |
◆ DisabledSprite
Sprite MoreMountains.Tools.MMTouchButton.DisabledSprite |
◆ HighlightedChangeColor
bool MoreMountains.Tools.MMTouchButton.HighlightedChangeColor = false |
◆ HighlightedColor
Color MoreMountains.Tools.MMTouchButton.HighlightedColor = Color.white |
◆ HighlightedSprite
Sprite MoreMountains.Tools.MMTouchButton.HighlightedSprite |
◆ IdleAnimationParameterName
string MoreMountains.Tools.MMTouchButton.IdleAnimationParameterName = "Idle" |
◆ IdleOpacity
float MoreMountains.Tools.MMTouchButton.IdleOpacity = 1f |
◆ Interactable
bool MoreMountains.Tools.MMTouchButton.Interactable = true |
whether or not this button can be interacted with
◆ MouseMode
bool MoreMountains.Tools.MMTouchButton.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).
◆ PressedAnimationParameterName
string MoreMountains.Tools.MMTouchButton.PressedAnimationParameterName = "Pressed" |
◆ PressedChangeColor
bool MoreMountains.Tools.MMTouchButton.PressedChangeColor = false |
◆ PressedColor
Color MoreMountains.Tools.MMTouchButton.PressedColor = Color.white |
◆ PressedFirstTimeDelay
float MoreMountains.Tools.MMTouchButton.PressedFirstTimeDelay = 0f |
◆ PressedOpacity
float MoreMountains.Tools.MMTouchButton.PressedOpacity = 1f |
the new opacity to apply to the canvas group when the button is pressed
◆ PressedSprite
Sprite MoreMountains.Tools.MMTouchButton.PressedSprite |
◆ ReleasedDelay
float MoreMountains.Tools.MMTouchButton.ReleasedDelay = 0f |
◆ CurrentState
the current state of the button (off, down, pressed or up)
◆ ReturnToInitialSpriteAutomatically
bool MoreMountains.Tools.MMTouchButton.ReturnToInitialSpriteAutomatically |
|
getset |
◆ ButtonStateChange
System.Action<PointerEventData.FramePressState, PointerEventData> MoreMountains.Tools.MMTouchButton.ButtonStateChange |
The documentation for this class was generated from the following file:
- E:/Github/Store/HighroadEngine/Assets/HighroadEngine/MMTools/Tools/MMControls/MMTouchButton.cs