Show / Hide Table of Contents

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
ClickButtonImageIcon
ClickButtonSVGIcon
ClickButtonText
Namespace: AdrianMiasik.Components.Base
Assembly: Assembly-CSharp.dll
Syntax
public class ClickButton : Image, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ISerializationCallbackReceiver, ILayoutElement, ICanvasRaycastFilter, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IPointerExitHandler, IEventSystemHandler

Fields

| Improve this Doc View Source

m_clickHoldScale

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

m_clickReleaseScale

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

m_clickSound

Declaration
public AudioSource m_clickSound
Field Value
Type Description
UnityEngine.AudioSource
| Improve this Doc View Source

m_containerTarget

Declaration
public RectTransform m_containerTarget
Field Value
Type Description
UnityEngine.RectTransform
| Improve this Doc View Source

m_enableClickSound

Declaration
public bool m_enableClickSound
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

m_highestPitch

Declaration
public float m_highestPitch
Field Value
Type Description
System.Single
| Improve this Doc View Source

m_holdRamp

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

m_isHoldable

Can the user invoke this button more than once by holding it down?

Declaration
public bool m_isHoldable
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

m_isPitchVariationOn

Declaration
public bool m_isPitchVariationOn
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

m_lowestPitch

Declaration
public float m_lowestPitch
Field Value
Type Description
System.Single
| Improve this Doc View Source

m_onClick

Declaration
public UnityEvent m_onClick
Field Value
Type Description
UnityEngine.Events.UnityEvent
| Improve this Doc View Source

m_onDown

Declaration
public UnityEvent m_onDown
Field Value
Type Description
UnityEngine.Events.UnityEvent
| Improve this Doc View Source

m_onUp

Declaration
public UnityEvent m_onUp
Field Value
Type Description
UnityEngine.Events.UnityEvent

Methods

| Improve this Doc View Source

CancelHold()

Declaration
public void CancelHold()
| Improve this Doc View Source

Hide()

Declaration
public virtual void Hide()
| Improve this Doc View Source

Hold()

Declaration
public void Hold()
| Improve this Doc View Source

OnPointerClick(PointerEventData)

Declaration
public void OnPointerClick(PointerEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.PointerEventData eventData
| Improve this Doc View Source

OnPointerDown(PointerEventData)

Declaration
public void OnPointerDown(PointerEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.PointerEventData eventData
| Improve this Doc View Source

OnPointerExit(PointerEventData)

Declaration
public void OnPointerExit(PointerEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.PointerEventData eventData
| Improve this Doc View Source

OnPointerUp(PointerEventData)

Declaration
public void OnPointerUp(PointerEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.PointerEventData eventData
| Improve this Doc View Source

OpenURL(String)

Declaration
public void OpenURL(string url)
Parameters
Type Name Description
System.String url
| Improve this Doc View Source

Release()

Declaration
public void Release()
| Improve this Doc View Source

Show()

Declaration
public virtual void Show()
| Improve this Doc View Source

Start()

Declaration
protected override void Start()
Overrides
UnityEngine.EventSystems.UIBehaviour.Start()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX