From eb27e5fd31f73b998a4bbd85511a31e40b8c61b7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 21 十一月 2025 17:03:47 +0800
Subject: [PATCH] 0312 关闭游戏内日志
---
Main/Component/UI/Common/ClickScreenOtherSpace.cs | 113 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 66 insertions(+), 47 deletions(-)
diff --git a/Main/Component/UI/Common/ClickScreenOtherSpace.cs b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
index a4c33bc..f2dd64b 100644
--- a/Main/Component/UI/Common/ClickScreenOtherSpace.cs
+++ b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
@@ -5,59 +5,78 @@
using System;
using UnityEngine.Events;
- [RequireComponent(typeof(RectTransform))]
- public class ClickScreenOtherSpace : MonoBehaviour
+//鐐瑰嚮鍏朵粬鍖哄煙瑙﹀彂鎺у埗鏄鹃殣 鍙檮鍔犱簨浠�
+[RequireComponent(typeof(RectTransform))]
+public class ClickScreenOtherSpace : MonoBehaviour
+{
+ [SerializeField]
+ bool m_DeActiveSelf = true;
+ public bool deActiveSelf {
+ get { return m_DeActiveSelf; }
+ set { m_DeActiveSelf = value; }
+ }
+
+ [SerializeField]
+ RespondType m_RespondType = RespondType.Out;
+ public RespondType respondType {
+ get { return m_RespondType; }
+ set { m_RespondType = value; }
+ }
+
+ Action m_ClickOtherEvent;
+
+ public void AddListener(Action _callBack)
{
- [SerializeField]
- bool m_DeActiveSelf = true;
- public bool deActiveSelf {
- get { return m_DeActiveSelf; }
- set { m_DeActiveSelf = value; }
- }
+ m_ClickOtherEvent = null;
+ m_ClickOtherEvent += _callBack;
+ }
- [SerializeField]
- RespondType m_RespondType = RespondType.Out;
- public RespondType respondType {
- get { return m_RespondType; }
- set { m_RespondType = value; }
- }
+ public void RemoveAllListeners()
+ {
+ m_ClickOtherEvent = null;
+ }
- Action m_ClickOtherEvent;
- public void AddListener(Action _callBack)
+ private void LateUpdate()
+ {
+ if (Input.GetMouseButtonDown(0))
{
- m_ClickOtherEvent += _callBack;
- }
-
- public void RemoveAllListeners()
- {
- m_ClickOtherEvent = null;
- }
-
- private void LateUpdate()
- {
- if (Input.GetMouseButtonDown(0)) {
- var sp = Input.mousePosition;
- switch (m_RespondType) {
- case RespondType.In:
- if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent.Invoke();
- this.SetActive(!m_DeActiveSelf);
- }
- break;
- case RespondType.Out:
- if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent.Invoke();
- this.SetActive(!m_DeActiveSelf);
- }
- break;
- }
+ var sp = Input.mousePosition;
+ switch (m_RespondType)
+ {
+ case RespondType.In:
+ if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera))
+ {
+ this.SetActive(!m_DeActiveSelf);
+ m_ClickOtherEvent?.Invoke();
+ }
+ break;
+ case RespondType.Out:
+ if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera))
+ {
+ this.SetActive(!m_DeActiveSelf);
+ m_ClickOtherEvent?.Invoke();
+ }
+ break;
}
}
-
- public enum RespondType
+ else if (Input.GetMouseButtonUp(0))
{
- In,
- Out,
+ switch (m_RespondType)
+ {
+ case RespondType.InOut:
+ this.SetActive(!m_DeActiveSelf);
+ m_ClickOtherEvent?.Invoke();
+ break;
+ }
}
- }
\ No newline at end of file
+ }
+
+ public enum RespondType
+ {
+ In,
+ Out,
+ InOut
+
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0