mirror of
https://github.com/peng-zhihui/ElectronBot.git
synced 2026-10-21 22:56:26 +08:00
46 lines
1016 B
C#
46 lines
1016 B
C#
namespace UIWidgets
|
|
{
|
|
using UnityEngine.Events;
|
|
using UnityEngine.EventSystems;
|
|
|
|
/// <summary>
|
|
/// Tree node toggle.
|
|
/// </summary>
|
|
public class TreeNodeToggle : UIBehaviour, IPointerUpHandler, IPointerDownHandler, IPointerClickHandler
|
|
{
|
|
/// <summary>
|
|
/// OnClick event.
|
|
/// </summary>
|
|
public UnityEvent OnClick = new UnityEvent();
|
|
|
|
/// <summary>
|
|
/// Process the pointer up event.
|
|
/// </summary>
|
|
/// <param name="eventData">Event data.</param>
|
|
public void OnPointerUp(PointerEventData eventData)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Process the pointer down event.
|
|
/// </summary>
|
|
/// <param name="eventData">Event data.</param>
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Process the pointer click event.
|
|
/// </summary>
|
|
/// <param name="eventData">Event data.</param>
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
if (eventData.button != PointerEventData.InputButton.Left)
|
|
{
|
|
return;
|
|
}
|
|
|
|
OnClick.Invoke();
|
|
}
|
|
}
|
|
} |