protected virtual void TearDown() { DestroyNodesAndGraphBuffers(); m_AnimationGraphSystem.RemoveRef(); if (m_Manager != null) { // Clean up systems before calling CheckInternalConsistency because we might have filters etc // holding on SharedComponentData making checks fail var system = World.GetExistingSystem <ComponentSystemBase>(); while (system != null) { World.DestroySystem(system); system = World.GetExistingSystem <ComponentSystemBase>(); } m_ManagerDebug.CheckInternalConsistency(); World.Dispose(); World = null; m_Manager = null; } }
protected override void OnDestroy() { if (m_GraphSystem == null) { return; } // Clean up all our nodes in the graph var nodes = m_GraphSystem.Set; Entities .WithoutBurst() .WithStructuralChanges() .ForEach((Entity e, ref PlayClipStateComponent data) => { DestroyGraph(nodes, ref data); }).Run(); // Decrease the reference count on the graph system so it knows // that we are done using it. m_GraphSystem.RemoveRef(); base.OnDestroy(); }