private void SelectEntity(Vector2 mousePos)
    {
        var selectedEntity = new Entity
        {
            Index = ColorToIndex(GetColorAtMousePos(mousePos, _objectIDRenderTarget))
        };

        if (_entityIndexToVersion.ContainsKey(selectedEntity.Index))
        {
            selectedEntity.Version = _entityIndexToVersion[selectedEntity.Index];
            EntitySelectionProxy.SelectEntity(World, selectedEntity);
        }
        else
        {
            Selection.activeObject = null;
        }
    }
        public IEnumerator Selection_DestroyingSelectedEntityDeselectInView()
        {
            var internalListView = WindowRoot.Q <TreeView>(Constants.EntityHierarchy.FullViewName).Q <ListView>();

            var e    = m_Manager.CreateEntity();
            var node = EntityHierarchyNodeId.FromEntity(e);

            yield return(SkipAnEditorFrameAndDiffingUtility());

            Assert.That(internalListView.currentSelectionIds, Is.Empty);

            EntitySelectionProxy.SelectEntity(m_Manager.World, e);
            yield return(null);

            Assert.That(internalListView.currentSelectionIds, Is.EquivalentTo(new[] { node.GetHashCode() }));

            m_Manager.DestroyEntity(e);
            yield return(SkipAnEditorFrameAndDiffingUtility());

            Assert.That(internalListView.selectedItems, Is.Empty);
        }