コード例 #1
0
 private void SelectInInspector(PageSelection selection, bool forceSelectInInspector)
 {
     // There are 3 situations when we want to select a package in the inspector
     // 1) we explicitly/force to select it as a result of a manual action (in this case, forceSelectInInspector should be set to true)
     // 2) currently there's no active selection at all
     // 3) currently another package is selected in inspector, hence we are sure that we are not stealing selection from some other window
     if (forceSelectInInspector || m_Selection.activeObject == null || m_Selection.activeObject is PackageSelectionObject)
     {
         var packageSelectionObjects = selection.Select(s => GetPackageSelectionObject(s, true)).ToArray();
         m_Selection.objects = packageSelectionObjects;
     }
 }
コード例 #2
0
 public IEnumerable <VisualState> GetSelectedVisualStates()
 {
     return(m_Selection.Select(s => GetVisualState(s)).Where(v => v != null));
 }