您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
28 行
754 B
28 行
754 B
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
[AddComponentMenu("UOP1/UI/MultiInputSelectableElement")]
|
|
public class MultiInputSelectableElement : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, ISelectHandler
|
|
{
|
|
private MenuSelectionHandler _menuSelectionHandler;
|
|
|
|
private void Awake()
|
|
{
|
|
_menuSelectionHandler = transform.root.gameObject.GetComponentInChildren<MenuSelectionHandler>();
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
_menuSelectionHandler.HandleMouseEnter(gameObject);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
_menuSelectionHandler.HandleMouseExit(gameObject);
|
|
}
|
|
|
|
public void OnSelect(BaseEventData eventData)
|
|
{
|
|
_menuSelectionHandler.UpdateSelection(gameObject);
|
|
}
|
|
}
|