From 22302ab443526bd3cc41af4b9becc588991f41a8 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Mon, 29 Apr 2024 22:12:51 +0800 Subject: [PATCH] fix --- src/Debug/UnityDebugService.cs | 2 ++ src/Internal/Editor/UnityEditorUtility.cs | 31 +++++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/Debug/UnityDebugService.cs b/src/Debug/UnityDebugService.cs index 00a0e15..acca69e 100644 --- a/src/Debug/UnityDebugService.cs +++ b/src/Debug/UnityDebugService.cs @@ -5,7 +5,9 @@ using UnityEngine; namespace DCFApixels.DragonECS { +#if UNITY_EDITOR [InitializeOnLoad] +#endif public class UnityDebugService : DebugService { private ProfilerMarker[] _profilerMarkers = new ProfilerMarker[64]; diff --git a/src/Internal/Editor/UnityEditorUtility.cs b/src/Internal/Editor/UnityEditorUtility.cs index c1fd138..45efc0a 100644 --- a/src/Internal/Editor/UnityEditorUtility.cs +++ b/src/Internal/Editor/UnityEditorUtility.cs @@ -1,5 +1,4 @@ -#if UNITY_EDITOR -using DCFApixels.DragonECS.Unity.Internal; +using DCFApixels.DragonECS.Unity.Internal; using System; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -9,16 +8,8 @@ using UnityEngine; namespace DCFApixels.DragonECS.Unity.Editors { - [InitializeOnLoad] - internal static class UnityEditorUtility + internal static partial class UnityEditorUtility { - static UnityEditorUtility() - { - colorBoxeStyles = new SparseArray(); - } - private static SparseArray colorBoxeStyles = new SparseArray(); - private static GUIContent _singletonContent = null; - #region TransformFieldName public static string TransformToUpperName(string name) { @@ -104,6 +95,24 @@ namespace DCFApixels.DragonECS.Unity.Editors } #endregion + } +} + + +#if UNITY_EDITOR +namespace DCFApixels.DragonECS.Unity.Editors +{ + [InitializeOnLoad] + internal static partial class UnityEditorUtility + { + static UnityEditorUtility() + { + colorBoxeStyles = new SparseArray(); + } + private static SparseArray colorBoxeStyles = new SparseArray(); + private static GUIContent _singletonContent = null; + + #region Label public static GUIContent GetLabelTemp() {