This commit is contained in:
Mikhail 2024-03-11 03:22:01 +08:00
parent 7c23350cdc
commit 16fde5c3c9

View File

@ -63,8 +63,11 @@ namespace DCFApixels.DragonECS.Unity.Internal
void IEcsWorldEventListener.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer) { } void IEcsWorldEventListener.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer) { }
void IEcsWorldEventListener.OnWorldDestroy() void IEcsWorldEventListener.OnWorldDestroy()
{ {
UnityEngine.Object.Destroy(_monitor); if (Application.isPlaying)
UnityEngine.Object.Destroy(_entityMonitorsPoolRoot); {
UnityEngine.Object.Destroy(_monitor);
UnityEngine.Object.Destroy(_entityMonitorsPoolRoot);
}
_monitor = null; _monitor = null;
_entityMonitorsPoolRoot = null; _entityMonitorsPoolRoot = null;
} }