protected override void OnWorldSelected(World world) { if (world == World) { return; } State?.Dispose(); GroupingStrategy?.Dispose(); m_EntityHierarchyDiffer?.Dispose(); State = null; GroupingStrategy = null; m_EntityHierarchyDiffer = null; World = world; if (World != null) { // TODO: How do we instantiate the correct State/Strategy combination? // TODO: Should we even allow the State to be overridable by users? State = new EntityHierarchyState(world); GroupingStrategy = new EntityHierarchyDefaultGroupingStrategy(world, State); m_EntityHierarchyDiffer = new EntityHierarchyDiffer(this, DisableDifferCooldownPeriod ? 0 : 16); m_EntityHierarchy.Refresh(this); } else { m_EntityHierarchy.Clear(); } }
void OnDisable() { LiveLinkConfigHelper.LiveLinkEnabledChanged -= UpdateEnableLiveLinkMessage; EditorApplication.playModeStateChanged -= UpdateEnableLiveLinkMessage; m_EntityHierarchy.Dispose(); State?.Dispose(); GroupingStrategy?.Dispose(); m_EntityHierarchyDiffer?.Dispose(); }