更多兼容性编译选项

This commit is contained in:
2025-06-07 10:48:24 +08:00
parent 1c9a06ba08
commit f2e0def54e
2 changed files with 20 additions and 6 deletions
+6
View File
@@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
#if ODIN_INSPECTOR
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
#endif
using UnityEngine; using UnityEngine;
using XericLibrary.Runtime.MacroLibrary; using XericLibrary.Runtime.MacroLibrary;
using Object = UnityEngine.Object; using Object = UnityEngine.Object;
@@ -26,15 +28,19 @@ namespace XericLibrary.Runtime.Type.Base
/// <summary> /// <summary>
/// 对象 /// 对象
/// </summary> /// </summary>
#if ODIN_INSPECTOR
[HorizontalGroup("SoftRef")] [HorizontalGroup("SoftRef")]
[HideLabel] [HideLabel]
#endif
public GameObject targetObejct; public GameObject targetObejct;
/// <summary> /// <summary>
/// 路径 /// 路径
/// </summary> /// </summary>
#if ODIN_INSPECTOR
[HorizontalGroup("SoftRef")] [HorizontalGroup("SoftRef")]
[HideLabel] [HideLabel]
#endif
public string targetPath; public string targetPath;
/// <summary> /// <summary>
+14 -6
View File
@@ -8,12 +8,17 @@ using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
using UnityEngine.UI; using UnityEngine.UI;
using XericLibrary.Runtime.CustomEditor; using XericLibrary.Runtime.CustomEditor;
using Object = UnityEngine.Object;
#if ODIN_INSPECTOR
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
#if UNITY_EDITOR #endif
#if UNITY_EDITOR && ODIN_INSPECTOR
using Sirenix.Utilities.Editor; using Sirenix.Utilities.Editor;
#endif #endif
using Object = UnityEngine.Object;
namespace XericLibrary.Runtime.MacroLibrary namespace XericLibrary.Runtime.MacroLibrary
{ {
/// <summary> /// <summary>
@@ -133,10 +138,13 @@ namespace XericLibrary.Runtime.MacroLibrary
#endregion #endregion
#region 字段属性 #region 字段属性
#if ODIN_INSPECTOR
[LabelText("单选组")] public ToggleGroup ToggleGroup; [LabelText("单选组")]
#endif
public ToggleGroup ToggleGroup;
#if ODIN_INSPECTOR
[SerializeField, LabelText("编辑单选项目顺序")] [ListDrawerSettings(OnTitleBarGUI = "GetAndSortToggle")] [SerializeField, LabelText("编辑单选项目顺序")] [ListDrawerSettings(OnTitleBarGUI = "GetAndSortToggle")]
#endif
private List<Toggle> toggleList = new List<Toggle>(); private List<Toggle> toggleList = new List<Toggle>();
// 当前选中的项目 // 当前选中的项目
@@ -162,7 +170,7 @@ namespace XericLibrary.Runtime.MacroLibrary
/// </summary> /// </summary>
public void GetAndSortToggle() public void GetAndSortToggle()
{ {
#if UNITY_EDITOR #if UNITY_EDITOR && ODIN_INSPECTOR
// 自动获取并排序 // 自动获取并排序
if (SirenixEditorGUI.ToolbarButton(EditorIcons.Refresh)) if (SirenixEditorGUI.ToolbarButton(EditorIcons.Refresh))
{ {