Ejemplo n.º 1
0
 public static bool Contains(UnityEngine.Object obj)
 {
     return(Selection.Contains(obj.GetInstanceID()));
 }
 private bool IsSelected(Transform tr)
 {
     return(Selection.GetTransforms(SelectionMode.Unfiltered).Contains(tr));
 }
Ejemplo n.º 3
0
        public void DoLocalSelectionChange()
        {
            if (this.m_NextSelectionMine)
            {
                this.m_NextSelectionMine = false;
                return;
            }
            UnityEngine.Object[] filtered = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets);
            string[]             array    = new string[0];
            switch (this.m_FileViewWin.SelType)
            {
            case ASHistoryFileView.SelectionType.All:
                if (Selection.objects.Length != 0)
                {
                    Selection.objects        = new UnityEngine.Object[0];
                    this.m_NextSelectionMine = true;
                }
                this.m_SelectedPath = string.Empty;
                this.m_SelectedGUID = string.Empty;
                this.ClearLV();
                break;

            case ASHistoryFileView.SelectionType.Items:
                if (filtered.Length < 1)
                {
                    this.m_SelectedPath = string.Empty;
                    this.m_SelectedGUID = string.Empty;
                    this.ClearLV();
                    return;
                }
                this.m_SelectedPath = AssetDatabase.GetAssetPath(filtered[0]);
                this.m_SelectedGUID = AssetDatabase.AssetPathToGUID(this.m_SelectedPath);
                array = this.m_FileViewWin.GetImplicitProjectViewSelection();
                break;

            case ASHistoryFileView.SelectionType.DeletedItemsRoot:
                if (Selection.objects.Length != 0)
                {
                    Selection.objects        = new UnityEngine.Object[0];
                    this.m_NextSelectionMine = true;
                }
                array = this.m_FileViewWin.GetAllDeletedItemGUIDs();
                if (array.Length == 0)
                {
                    this.ClearLV();
                    return;
                }
                break;

            case ASHistoryFileView.SelectionType.DeletedItems:
                if (Selection.objects.Length != 0)
                {
                    Selection.objects        = new UnityEngine.Object[0];
                    this.m_NextSelectionMine = true;
                }
                array = this.m_FileViewWin.GetSelectedDeletedItemGUIDs();
                break;
            }
            this.m_Changesets = AssetServer.GetHistorySelected(array);
            if (this.m_Changesets != null)
            {
                this.FilterItems(true);
            }
            else
            {
                this.ClearLV();
            }
            if (array != null && this.m_GUIItems != null && array.Length == 1)
            {
                this.MarkBoldItemsByGUID(this.m_SelectedGUID);
            }
            this.m_ParentWindow.Repaint();
        }