void OnSelectionChangedByInspector(World world, Entity entity) { if (world != m_Hierarchy.World) { return; } var nodeId = EntityHierarchyNodeId.FromEntity(entity); if (!m_Hierarchy.Strategy.Exists(nodeId)) { return; } Select(nodeId.GetHashCode()); }
void IEntityHierarchyGroupingStrategy.ApplyEntityChanges(NativeArray <Entity> newEntities, NativeArray <Entity> removedEntities, IEntityHierarchyGroupingContext context) { // Remove entities foreach (var entity in removedEntities) { m_State.RegisterRemoveOperation(EntityHierarchyNodeId.FromEntity(entity)); } // Add new entities foreach (var entity in newEntities) { m_State.RegisterAddEntityOperation(entity, out _); } UpdateMissingParentEntities(); MoveEntitiesUnderFoundMissingParents(); }
void OnGlobalSelectionChanged() { if (Selection.activeObject is EntitySelectionProxy selectedProxy && selectedProxy.World == m_Hierarchy.World) { TrySelect(EntityHierarchyNodeId.FromEntity(selectedProxy.Entity)); }