mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
rework UnityDebugService initialization
This commit is contained in:
parent
9bae371c25
commit
1620484297
@ -1,30 +1,15 @@
|
||||
using DCFApixels.DragonECS.Unity.Internal;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Unity.Profiling;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
#region [InitializeOnLoad]
|
||||
#if UNITY_EDITOR
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
using UnityEditor;
|
||||
[InitializeOnLoad]
|
||||
public partial class UnityDebugService { }
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
// Методы юнитевского Debug и ProfilerMarker потоко безопасны
|
||||
public partial class UnityDebugService : DebugService
|
||||
{
|
||||
private ProfilerMarker[] _profilerMarkers = new ProfilerMarker[64];
|
||||
static UnityDebugService()
|
||||
{
|
||||
Activate();
|
||||
}
|
||||
|
||||
public static void Activate()
|
||||
{
|
||||
if (Instance.GetType() == typeof(UnityDebugService)) { return; }
|
||||
|
@ -109,8 +109,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
static UnityEditorUtility()
|
||||
{
|
||||
const int PREWARMUP_LIST_SIZE = 64;
|
||||
EcsWorld.ResetStaticState();
|
||||
UnityDebugService.Activate();
|
||||
OnLoad();
|
||||
|
||||
_integrationAssembly = typeof(UnityEditorUtility).Assembly;
|
||||
|
||||
@ -212,7 +211,10 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
private static void OnLoad()
|
||||
{
|
||||
EcsWorld.ResetStaticState();
|
||||
UnityDebugService.Activate();
|
||||
if (DebugService.IsNullOrDefault)
|
||||
{
|
||||
UnityDebugService.Activate();
|
||||
}
|
||||
}
|
||||
|
||||
internal static readonly Assembly _integrationAssembly;
|
||||
|
Loading…
Reference in New Issue
Block a user