From f2e0def54e8e03817a01a37755ec8c38f74f3551 Mon Sep 17 00:00:00 2001
From: LiRuoChen <571244399@qq.com>
Date: Sat, 7 Jun 2025 10:48:24 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E5=85=BC=E5=AE=B9=E6=80=A7?=
=?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Runtime/StructType/GowSoftRef.cs | 6 ++++++
Runtime/UI/MacroUI.cs | 20 ++++++++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/Runtime/StructType/GowSoftRef.cs b/Runtime/StructType/GowSoftRef.cs
index 975d786..dcd11e9 100644
--- a/Runtime/StructType/GowSoftRef.cs
+++ b/Runtime/StructType/GowSoftRef.cs
@@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+#if ODIN_INSPECTOR
using Sirenix.OdinInspector;
+#endif
using UnityEngine;
using XericLibrary.Runtime.MacroLibrary;
using Object = UnityEngine.Object;
@@ -26,15 +28,19 @@ namespace XericLibrary.Runtime.Type.Base
///
/// 对象
///
+#if ODIN_INSPECTOR
[HorizontalGroup("SoftRef")]
[HideLabel]
+#endif
public GameObject targetObejct;
///
/// 路径
///
+#if ODIN_INSPECTOR
[HorizontalGroup("SoftRef")]
[HideLabel]
+#endif
public string targetPath;
///
diff --git a/Runtime/UI/MacroUI.cs b/Runtime/UI/MacroUI.cs
index cf0ff62..47fcce0 100644
--- a/Runtime/UI/MacroUI.cs
+++ b/Runtime/UI/MacroUI.cs
@@ -8,12 +8,17 @@ using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using XericLibrary.Runtime.CustomEditor;
-using Object = UnityEngine.Object;
+
+#if ODIN_INSPECTOR
using Sirenix.OdinInspector;
-#if UNITY_EDITOR
+#endif
+
+#if UNITY_EDITOR && ODIN_INSPECTOR
using Sirenix.Utilities.Editor;
#endif
+using Object = UnityEngine.Object;
+
namespace XericLibrary.Runtime.MacroLibrary
{
///
@@ -133,10 +138,13 @@ namespace XericLibrary.Runtime.MacroLibrary
#endregion
#region 字段属性
-
- [LabelText("单选组")] public ToggleGroup ToggleGroup;
-
+#if ODIN_INSPECTOR
+ [LabelText("单选组")]
+#endif
+ public ToggleGroup ToggleGroup;
+#if ODIN_INSPECTOR
[SerializeField, LabelText("编辑单选项目顺序")] [ListDrawerSettings(OnTitleBarGUI = "GetAndSortToggle")]
+#endif
private List toggleList = new List();
// 当前选中的项目
@@ -162,7 +170,7 @@ namespace XericLibrary.Runtime.MacroLibrary
///
public void GetAndSortToggle()
{
-#if UNITY_EDITOR
+#if UNITY_EDITOR && ODIN_INSPECTOR
// 自动获取并排序
if (SirenixEditorGUI.ToolbarButton(EditorIcons.Refresh))
{