From 61b166f1585487316c343bd90c44dcc9414da9d8 Mon Sep 17 00:00:00 2001 From: LiRuoChen <571244399@qq.com> Date: Mon, 27 Jul 2026 11:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E8=B1=A1uiactive=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Core/Base/XericUIBehaviour.cs | 21 ++++----------------- Runtime/Form.meta | 8 ++++++++ Runtime/Form/Appoint.meta | 8 ++++++++ Runtime/Form/Appoint/IActivity.cs | 21 +++++++++++++++++++++ Runtime/Form/Appoint/IActivity.cs.meta | 11 +++++++++++ 5 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 Runtime/Form.meta create mode 100644 Runtime/Form/Appoint.meta create mode 100644 Runtime/Form/Appoint/IActivity.cs create mode 100644 Runtime/Form/Appoint/IActivity.cs.meta diff --git a/Runtime/Core/Base/XericUIBehaviour.cs b/Runtime/Core/Base/XericUIBehaviour.cs index 2fd12d0..0b49b72 100644 --- a/Runtime/Core/Base/XericUIBehaviour.cs +++ b/Runtime/Core/Base/XericUIBehaviour.cs @@ -6,10 +6,11 @@ using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +using XericUI.Form; namespace XericUI.Core.Base { - public class XericUIBehaviour : UIBehaviour + public class XericUIBehaviour : UIBehaviour, IActivity { #if ODIN_INSPECTOR [InfoBox("脚本必填属性存在空引用!请检查开放属性后再试", InfoMessageType.Error, VisibleIf = "PublicFieldNullReference")] @@ -272,23 +273,9 @@ namespace XericUI.Core.Base #region 显影 - public virtual void Show() - { - gameObject.SetActive(true); - } + public virtual void Show() => gameObject.SetActive(true); - public void Show(bool isShow) - { - if (isShow) - Show(); - else - Hide(); - } - - public virtual void Hide() - { - gameObject.SetActive(false); - } + public virtual void Hide() => gameObject.SetActive(false); #endregion } diff --git a/Runtime/Form.meta b/Runtime/Form.meta new file mode 100644 index 0000000..c3f3cfe --- /dev/null +++ b/Runtime/Form.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d16f5d84c8b723f4086a57342d265178 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Form/Appoint.meta b/Runtime/Form/Appoint.meta new file mode 100644 index 0000000..ab60303 --- /dev/null +++ b/Runtime/Form/Appoint.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2de2d1d1185283640a226edd18b116cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Form/Appoint/IActivity.cs b/Runtime/Form/Appoint/IActivity.cs new file mode 100644 index 0000000..89f0fa1 --- /dev/null +++ b/Runtime/Form/Appoint/IActivity.cs @@ -0,0 +1,21 @@ +namespace XericUI.Form +{ + public interface IActivity + { + public void Show(); + public void Hide(); + } + + public static class ActivedExtend + { + public static bool Show(this IActivity target, bool isShow) + { + if (target == null) return isShow; + if (isShow) + target.Show(); + else + target.Hide(); + return isShow; + } + } +} \ No newline at end of file diff --git a/Runtime/Form/Appoint/IActivity.cs.meta b/Runtime/Form/Appoint/IActivity.cs.meta new file mode 100644 index 0000000..2d066e7 --- /dev/null +++ b/Runtime/Form/Appoint/IActivity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d731fec7098a95c4f85907e275e211a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: