Class OnScreenButton
A button that is visually represented on-screen and triggered by touch or other pointer input.
Implements
IPointerDownHandler
IPointerUpHandler
IEventSystemHandler
Inherited Members
Namespace: UnityEngine.InputSystem.OnScreen
Assembly: Unity.InputSystem.dll
Syntax
[AddComponentMenu("Input/On-Screen Button")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.inputsystem@1.10/manual/OnScreen.html#on-screen-buttons")]
public class OnScreenButton : OnScreenControl, IPointerDownHandler, IPointerUpHandler, IEventSystemHandler
Properties
controlPathInternal
Accessor for the controlPath of the component. Must be implemented by subclasses.
Declaration
protected override string controlPathInternal { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
Remarks
Moving the definition of how the control path is stored into subclasses allows them to apply their own InputControlAttribute attributes to them and thus set their own layout filters.
Methods
OnPointerDown(PointerEventData)
Use this callback to detect pointer down events.
Declaration
public void OnPointerDown(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData |
OnPointerUp(PointerEventData)
Use this callback to detect pointer up events.
Declaration
public void OnPointerUp(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData |
Implements
UnityEngine.EventSystems.IPointerDownHandler
UnityEngine.EventSystems.IPointerUpHandler
UnityEngine.EventSystems.IEventSystemHandler