This commit is contained in:
Mikhail 2024-03-29 22:28:44 +08:00
parent 4a41526f4a
commit 93f93a3ddb

View File

@ -73,8 +73,14 @@ namespace DCFApixels.DragonECS.Unity.Internal
{
if (Application.isPlaying)
{
UnityEngine.Object.Destroy(_monitor.gameObject);
UnityEngine.Object.Destroy(_entityMonitorsPoolRoot.gameObject);
if (_monitor != null)
{
UnityEngine.Object.Destroy(_monitor.gameObject);
}
if (_entityMonitorsPoolRoot != null)
{
UnityEngine.Object.Destroy(_entityMonitorsPoolRoot.gameObject);
}
}
_monitor = null;
_entityMonitorsPoolRoot = null;