Class ClickButton
A generic button that is used to interact with the software and trigger events based on user input.
Supports animations, click hold curves, unity events, and sound FX (with pitch variation).
Intended to be used on all our application buttons.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
UnityEngine.EventSystems.UIBehaviour
UnityEngine.UI.Graphic
UnityEngine.UI.MaskableGraphic
UnityEngine.UI.Image
ClickButton
Assembly: Assembly-CSharp.dll
public class ClickButton : Image, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ISerializationCallbackReceiver, ILayoutElement, ICanvasRaycastFilter, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IPointerExitHandler, IEventSystemHandler
Fields
|
Improve this Doc
View Source
What transform scale do you want the target to scale to on button press?
Declaration
public float m_clickHoldScale
Field Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
What transform scale (animation over time) do you want the target to scale to on button release/after click?
Used as a release animation.
Declaration
public AnimationCurve m_clickReleaseScale
Field Value
Type |
Description |
UnityEngine.AnimationCurve |
|
|
Improve this Doc
View Source
Declaration
public AudioSource m_clickSound
Field Value
Type |
Description |
UnityEngine.AudioSource |
|
|
Improve this Doc
View Source
Declaration
public RectTransform m_containerTarget
Field Value
Type |
Description |
UnityEngine.RectTransform |
|
|
Improve this Doc
View Source
Declaration
public bool m_enableClickSound
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public float m_highestPitch
Field Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
How fast do you want to press/click the button when user is holding down the button? Initially set to be
somewhat exponentially faster. This way the longer the user holds, the faster we invoke the next click.
Ideally scenario is incrementing / decrementing our timer digits.
Declaration
public AnimationCurve m_holdRamp
Field Value
Type |
Description |
UnityEngine.AnimationCurve |
|
|
Improve this Doc
View Source
Can the user invoke this button more than once by holding it down?
Declaration
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public bool m_isPitchVariationOn
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public float m_lowestPitch
Field Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Declaration
public UnityEvent m_onClick
Field Value
Type |
Description |
UnityEngine.Events.UnityEvent |
|
|
Improve this Doc
View Source
Declaration
public UnityEvent m_onDown
Field Value
Type |
Description |
UnityEngine.Events.UnityEvent |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
UnityEngine.Events.UnityEvent |
|
Methods
|
Improve this Doc
View Source
Declaration
|
Improve this Doc
View Source
Declaration
public virtual void Hide()
|
Improve this Doc
View Source
Declaration
|
Improve this Doc
View Source
Declaration
public void OnPointerClick(PointerEventData eventData)
Parameters
Type |
Name |
Description |
UnityEngine.EventSystems.PointerEventData |
eventData |
|
|
Improve this Doc
View Source
Declaration
public void OnPointerDown(PointerEventData eventData)
Parameters
Type |
Name |
Description |
UnityEngine.EventSystems.PointerEventData |
eventData |
|
|
Improve this Doc
View Source
Declaration
public void OnPointerExit(PointerEventData eventData)
Parameters
Type |
Name |
Description |
UnityEngine.EventSystems.PointerEventData |
eventData |
|
|
Improve this Doc
View Source
Declaration
public void OnPointerUp(PointerEventData eventData)
Parameters
Type |
Name |
Description |
UnityEngine.EventSystems.PointerEventData |
eventData |
|
|
Improve this Doc
View Source
Declaration
public void OpenURL(string url)
Parameters
Type |
Name |
Description |
System.String |
url |
|
|
Improve this Doc
View Source
Declaration
|
Improve this Doc
View Source
Declaration
public virtual void Show()
|
Improve this Doc
View Source
Declaration
protected override void Start()
Overrides
UnityEngine.EventSystems.UIBehaviour.Start()