private void SetSelectionAndExpandedState(List <ISceneGraphNode> nodes) { var ids = AsInstanceIds(nodes.Select(n => n.Parent)) .Concat(nodes.Where(n => null == n.Parent).Select(n => n.Graph).OfType <SceneGraph>().Select(g => g.Scene.SceneGuid.GetHashCode())) .Distinct() .ToArray(); IdsToExpand.AddRange(ids); Selection.instanceIDs = AsInstanceIds(nodes).ToArray(); }
public void TransferSelection(List <Guid> guids) { var references = guids.Select(g => m_ComponentCache.GetEntityReference(g)).Where(r => r && null != r).ToList(); Selection.instanceIDs = references.Select(r => r.gameObject.GetInstanceID()).ToArray(); IdsToExpand.AddRange(references .Select(e => e.transform.parent) .Where(p => p && null != p) .Select(p => p.gameObject.GetInstanceID())); }