43 lines
895 B
C#
43 lines
895 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using System.Collections;
|
|
using System;
|
|
using UnityEngine.Events;
|
|
|
|
public class UIBackRayBehind : MonoBehaviour, IPointerClickHandler
|
|
{
|
|
[Serializable]
|
|
public class BackClickEvent : UnityEvent
|
|
{
|
|
public BackClickEvent()
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
[SerializeField]
|
|
public BackClickEvent _BackClick;
|
|
|
|
public bool _RayBehind = true;
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
if (_BackClick != null)
|
|
_BackClick.Invoke();
|
|
|
|
//if (!_RayBehind)
|
|
// return;
|
|
|
|
//if (gameObject.activeInHierarchy)
|
|
//{
|
|
// enabled = false;
|
|
// UIManager.Instance().RayCastBebind(eventData);
|
|
// enabled = true;
|
|
//}
|
|
//else
|
|
//{
|
|
// UIManager.Instance().RayCastBebind(eventData);
|
|
//}
|
|
}
|
|
}
|