yyl
2025-08-25 973edc44a04dceb8b48a32ca912e6167f86189d4
Main/Component/UI/Common/ClickScreenOtherSpace.cs
@@ -5,8 +5,6 @@
using System;
using UnityEngine.Events;
namespace vnxbqy.UI
{
    [RequireComponent(typeof(RectTransform))]
    public class ClickScreenOtherSpace : MonoBehaviour
    {
@@ -24,16 +22,16 @@
            set { m_RespondType = value; }
        }
        UIEvent m_ClickOtherEvent = new UIEvent();
        Action m_ClickOtherEvent;
        public void AddListener(UnityAction _callBack)
        public void AddListener(Action _callBack)
        {
            m_ClickOtherEvent.AddListener(_callBack);
            m_ClickOtherEvent += _callBack;
        }
        public void RemoveAllListeners()
        {
            m_ClickOtherEvent.RemoveAllListeners();
            m_ClickOtherEvent = null;
        }
        private void LateUpdate()
@@ -43,13 +41,13 @@
                switch (m_RespondType) {
                    case RespondType.In:
                        if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
                            m_ClickOtherEvent.Invoke();
                            m_ClickOtherEvent?.Invoke();
                            this.SetActive(!m_DeActiveSelf);
                        }
                        break;
                    case RespondType.Out:
                        if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
                            m_ClickOtherEvent.Invoke();
                            m_ClickOtherEvent?.Invoke();
                            this.SetActive(!m_DeActiveSelf);
                        }
                        break;
@@ -62,6 +60,4 @@
            In,
            Out,
        }
    }
}
    }