18 lines
360 B
C#
18 lines
360 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class HoldableButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
|
{
|
|
public bool isPressed;
|
|
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
{
|
|
isPressed = true;
|
|
}
|
|
|
|
public void OnPointerUp(PointerEventData eventData)
|
|
{
|
|
isPressed = false;
|
|
}
|
|
}
|