UnityEditor.ASHistoryWindow.DoLocalSelectionChange C# (CSharp) Méthode

DoLocalSelectionChange() public méthode

public DoLocalSelectionChange ( ) : void
Résultat void
        public void DoLocalSelectionChange()
        {
            if (this.m_NextSelectionMine)
            {
                this.m_NextSelectionMine = false;
            }
            else
            {
                Object[] filtered = Selection.GetFiltered(typeof(Object), SelectionMode.Assets);
                string[] guids = new string[0];
                switch (this.m_FileViewWin.SelType)
                {
                    case ASHistoryFileView.SelectionType.All:
                        if (Selection.objects.Length != 0)
                        {
                            Selection.objects = new Object[0];
                            this.m_NextSelectionMine = true;
                        }
                        this.m_SelectedPath = "";
                        this.m_SelectedGUID = "";
                        this.ClearLV();
                        break;

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

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

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

Usage Example

        private void DeletedItemsRootKeyboard(ASHistoryWindow parentWin)
        {
            switch (Event.current.keyCode)
            {
            case KeyCode.UpArrow:
                this.SelType = ASHistoryFileView.SelectionType.Items;
                if (this.GetLast() != null)
                {
                    Selection.activeObject = this.GetLast().pptrValue;
                    this.FrameObject(Selection.activeObject);
                    break;
                }
                break;

            case KeyCode.DownArrow:
                if (this.m_DelPVstate.selectedItems.Length > 0 && this.DeletedItemsToggle)
                {
                    this.SelType = ASHistoryFileView.SelectionType.DeletedItems;
                    this.m_DelPVstate.selectedItems[0] = true;
                    this.m_DelPVstate.lv.row           = 0;
                    this.ScrollToDeletedItem(0);
                    break;
                }
                break;

            case KeyCode.RightArrow:
                this.DeletedItemsToggle = true;
                break;

            case KeyCode.LeftArrow:
                this.DeletedItemsToggle = false;
                break;

            default:
                return;
            }
            if (this.SelType != ASHistoryFileView.SelectionType.Items)
            {
                parentWin.DoLocalSelectionChange();
            }
            Event.current.Use();
        }
All Usage Examples Of UnityEditor.ASHistoryWindow::DoLocalSelectionChange