protected override void OnWorldSelected(World world) { if (world == World) { return; } if (Strategy != null) { EntityHierarchyDiffSystem.Unregister(this); Strategy.Dispose(); Strategy = null; } World = world; if (World != null) { Strategy = new EntityHierarchyDefaultGroupingStrategy(world); EntityHierarchyDiffSystem.Register(this); m_EntityHierarchy.Refresh(this); } else { m_EntityHierarchy.Clear(); } }
void OnDisable() { LiveLinkConfigHelper.LiveLinkEnabledChanged -= UpdateEnableLiveLinkMessage; EditorApplication.playModeStateChanged -= UpdateEnableLiveLinkMessage; m_EntityHierarchy.Dispose(); if (Strategy != null) { EntityHierarchyDiffSystem.Unregister(this); Strategy.Dispose(); } }