mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-17 17:34:34 +08:00
fix unity object destroy exception
This commit is contained in:
parent
46aef0be48
commit
657f1edde6
@ -36,7 +36,7 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
||||
{
|
||||
TypeMeta meta = typeof(EcsPipeline).ToMeta();
|
||||
_monitor = new GameObject($"{UnityEditorUtility.TransformToUpperName(meta.Name)}").AddComponent<PipelineMonitor>();
|
||||
UnityEngine.Object.DontDestroyOnLoad(_monitor);
|
||||
Object.DontDestroyOnLoad(_monitor);
|
||||
_monitor.Set(Pipeline);
|
||||
_monitor.gameObject.SetActive(false);
|
||||
|
||||
@ -48,7 +48,10 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
UnityEngine.Object.Destroy(_monitor);
|
||||
if (_monitor != null)
|
||||
{
|
||||
Object.Destroy(_monitor.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user