mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-01 22:07:31 +00:00
19 lines
468 B
C#
19 lines
468 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.Events;
|
||
|
using UnityEngine.EventSystems;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class LeftClickEvent : Selectable
|
||
|
{
|
||
|
public UnityEvent OnLeftClick;
|
||
|
public override void OnPointerDown(PointerEventData eventData)
|
||
|
{
|
||
|
base.OnPointerDown(eventData);
|
||
|
|
||
|
if(eventData.button != PointerEventData.InputButton.Left) return;
|
||
|
OnLeftClick?.Invoke();
|
||
|
}
|
||
|
}
|