Previous() private method

private Previous ( int expanded ) : bool
expanded int
return bool
Exemplo n.º 1
0
        private void AssetViewKeyboard()
        {
            KeyCode keyCode = Event.current.keyCode;

            switch (keyCode)
            {
            case KeyCode.KeypadEnter:
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    this.OpenAssetSelection();
                    GUIUtility.ExitGUI();
                    break;
                }
                break;

            case KeyCode.UpArrow:
                Event.current.Use();
                HierarchyProperty firstSelected = this.GetFirstSelected();
                if (firstSelected != null)
                {
                    if (firstSelected.instanceID == this.GetFirst().instanceID)
                    {
                        this.SelType      = ASHistoryFileView.SelectionType.All;
                        Selection.objects = new UnityEngine.Object[0];
                        this.ScrollTo(0.0f);
                        break;
                    }
                    if (firstSelected.Previous(this.m_ExpandedArray))
                    {
                        UnityEngine.Object pptrValue = firstSelected.pptrValue;
                        this.SelectionClick(firstSelected);
                        this.FrameObject(pptrValue);
                        break;
                    }
                    break;
                }
                break;

            case KeyCode.DownArrow:
                Event.current.Use();
                HierarchyProperty lastSelected = this.GetLastSelected();
                if (Application.platform == RuntimePlatform.OSXEditor && Event.current.command)
                {
                    this.OpenAssetSelection();
                    GUIUtility.ExitGUI();
                    break;
                }
                if (lastSelected != null)
                {
                    if (lastSelected.instanceID == this.GetLast().instanceID)
                    {
                        this.SelType      = ASHistoryFileView.SelectionType.DeletedItemsRoot;
                        Selection.objects = new UnityEngine.Object[0];
                        this.ScrollToDeletedItem(-1);
                        break;
                    }
                    if (lastSelected.Next(this.m_ExpandedArray))
                    {
                        UnityEngine.Object pptrValue = lastSelected.pptrValue;
                        this.SelectionClick(lastSelected);
                        this.FrameObject(pptrValue);
                        break;
                    }
                    break;
                }
                break;

            case KeyCode.RightArrow:
                HierarchyProperty activeSelected1 = this.GetActiveSelected();
                if (activeSelected1 != null)
                {
                    this.SetExpanded(activeSelected1.instanceID, true);
                    break;
                }
                break;

            case KeyCode.LeftArrow:
                HierarchyProperty activeSelected2 = this.GetActiveSelected();
                if (activeSelected2 != null)
                {
                    this.SetExpanded(activeSelected2.instanceID, false);
                    break;
                }
                break;

            case KeyCode.Home:
                if (this.GetFirst() != null)
                {
                    Selection.activeObject = this.GetFirst().pptrValue;
                    this.FrameObject(Selection.activeObject);
                    break;
                }
                break;

            case KeyCode.End:
                if (this.GetLast() != null)
                {
                    Selection.activeObject = this.GetLast().pptrValue;
                    this.FrameObject(Selection.activeObject);
                    break;
                }
                break;

            case KeyCode.PageUp:
                Event.current.Use();
                if (ASHistoryFileView.OSX)
                {
                    this.m_ScrollPosition.y -= this.m_ScreenRect.height;
                    if ((double)this.m_ScrollPosition.y < 0.0)
                    {
                        this.m_ScrollPosition.y = 0.0f;
                        break;
                    }
                    break;
                }
                HierarchyProperty property1 = this.GetFirstSelected();
                if (property1 != null)
                {
                    for (int index = 0; (double)index < (double)this.m_ScreenRect.height / (double)ASHistoryFileView.m_RowHeight; ++index)
                    {
                        if (!property1.Previous(this.m_ExpandedArray))
                        {
                            property1 = this.GetFirst();
                            break;
                        }
                    }
                    UnityEngine.Object pptrValue = property1.pptrValue;
                    this.SelectionClick(property1);
                    this.FrameObject(pptrValue);
                    break;
                }
                if (this.GetFirst() != null)
                {
                    Selection.activeObject = this.GetFirst().pptrValue;
                    this.FrameObject(Selection.activeObject);
                    break;
                }
                break;

            case KeyCode.PageDown:
                Event.current.Use();
                if (ASHistoryFileView.OSX)
                {
                    this.m_ScrollPosition.y += this.m_ScreenRect.height;
                    break;
                }
                HierarchyProperty property2 = this.GetLastSelected();
                if (property2 != null)
                {
                    for (int index = 0; (double)index < (double)this.m_ScreenRect.height / (double)ASHistoryFileView.m_RowHeight; ++index)
                    {
                        if (!property2.Next(this.m_ExpandedArray))
                        {
                            property2 = this.GetLast();
                            break;
                        }
                    }
                    UnityEngine.Object pptrValue = property2.pptrValue;
                    this.SelectionClick(property2);
                    this.FrameObject(pptrValue);
                    break;
                }
                if (this.GetLast() != null)
                {
                    Selection.activeObject = this.GetLast().pptrValue;
                    this.FrameObject(Selection.activeObject);
                    break;
                }
                break;

            default:
                if (keyCode != KeyCode.Return)
                {
                    return;
                }
                goto case KeyCode.KeypadEnter;
            }
            Event.current.Use();
        }
Exemplo n.º 2
0
        private void AssetViewKeyboard()
        {
            switch (Event.current.keyCode)
            {
            case KeyCode.KeypadEnter:
            case KeyCode.Return:
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    this.OpenAssetSelection();
                    GUIUtility.ExitGUI();
                }
                break;

            case KeyCode.UpArrow:
            {
                Event.current.Use();
                HierarchyProperty firstSelected = this.GetFirstSelected();
                if (firstSelected != null)
                {
                    if (firstSelected.instanceID != this.GetFirst().instanceID)
                    {
                        if (firstSelected.Previous(this.m_ExpandedArray))
                        {
                            UnityEngine.Object pptrValue = firstSelected.pptrValue;
                            this.SelectionClick(firstSelected);
                            this.FrameObject(pptrValue);
                        }
                    }
                    else
                    {
                        this.SelType      = SelectionType.All;
                        Selection.objects = new UnityEngine.Object[0];
                        this.ScrollTo(0f);
                    }
                }
                break;
            }

            case KeyCode.DownArrow:
            {
                Event.current.Use();
                HierarchyProperty lastSelected = this.GetLastSelected();
                if ((Application.platform != RuntimePlatform.OSXEditor) || !Event.current.command)
                {
                    if (lastSelected != null)
                    {
                        if (lastSelected.instanceID == this.GetLast().instanceID)
                        {
                            this.SelType      = SelectionType.DeletedItemsRoot;
                            Selection.objects = new UnityEngine.Object[0];
                            this.ScrollToDeletedItem(-1);
                        }
                        else if (lastSelected.Next(this.m_ExpandedArray))
                        {
                            UnityEngine.Object target = lastSelected.pptrValue;
                            this.SelectionClick(lastSelected);
                            this.FrameObject(target);
                        }
                    }
                }
                else
                {
                    this.OpenAssetSelection();
                    GUIUtility.ExitGUI();
                }
                break;
            }

            case KeyCode.RightArrow:
            {
                HierarchyProperty activeSelected = this.GetActiveSelected();
                if (activeSelected != null)
                {
                    this.SetExpanded(activeSelected.instanceID, true);
                }
                break;
            }

            case KeyCode.LeftArrow:
            {
                HierarchyProperty property = this.GetActiveSelected();
                if (property != null)
                {
                    this.SetExpanded(property.instanceID, false);
                }
                break;
            }

            case KeyCode.Home:
                if (this.GetFirst() != null)
                {
                    Selection.activeObject = this.GetFirst().pptrValue;
                    this.FrameObject(Selection.activeObject);
                }
                break;

            case KeyCode.End:
                if (this.GetLast() != null)
                {
                    Selection.activeObject = this.GetLast().pptrValue;
                    this.FrameObject(Selection.activeObject);
                }
                break;

            case KeyCode.PageUp:
            {
                Event.current.Use();
                if (OSX)
                {
                    this.m_ScrollPosition.y -= this.m_ScreenRect.height;
                    if (this.m_ScrollPosition.y < 0f)
                    {
                        this.m_ScrollPosition.y = 0f;
                    }
                    break;
                }
                HierarchyProperty first = this.GetFirstSelected();
                if (first == null)
                {
                    if (this.GetFirst() != null)
                    {
                        Selection.activeObject = this.GetFirst().pptrValue;
                        this.FrameObject(Selection.activeObject);
                    }
                    break;
                }
                for (int i = 0; i < (this.m_ScreenRect.height / m_RowHeight); i++)
                {
                    if (!first.Previous(this.m_ExpandedArray))
                    {
                        first = this.GetFirst();
                        break;
                    }
                }
                UnityEngine.Object obj4 = first.pptrValue;
                this.SelectionClick(first);
                this.FrameObject(obj4);
                break;
            }

            case KeyCode.PageDown:
                Event.current.Use();
                if (!OSX)
                {
                    HierarchyProperty last = this.GetLastSelected();
                    if (last == null)
                    {
                        if (this.GetLast() != null)
                        {
                            Selection.activeObject = this.GetLast().pptrValue;
                            this.FrameObject(Selection.activeObject);
                        }
                        break;
                    }
                    for (int j = 0; j < (this.m_ScreenRect.height / m_RowHeight); j++)
                    {
                        if (!last.Next(this.m_ExpandedArray))
                        {
                            last = this.GetLast();
                            break;
                        }
                    }
                    UnityEngine.Object obj5 = last.pptrValue;
                    this.SelectionClick(last);
                    this.FrameObject(obj5);
                    break;
                }
                this.m_ScrollPosition.y += this.m_ScreenRect.height;
                break;

            default:
                return;
            }
            Event.current.Use();
        }
Exemplo n.º 3
0
        private void AssetViewKeyboard()
        {
            KeyCode keyCode = Event.current.keyCode;

            switch (keyCode)
            {
            case KeyCode.KeypadEnter:
                goto IL_1C6;

            case KeyCode.KeypadEquals:
            case KeyCode.Insert:
IL_44:
                if (keyCode != KeyCode.Return)
                {
                    return;
                }
                goto IL_1C6;

            case KeyCode.UpArrow:
            {
                Event.current.Use();
                HierarchyProperty firstSelected = this.GetFirstSelected();
                if (firstSelected != null)
                {
                    if (firstSelected.instanceID == this.GetFirst().instanceID)
                    {
                        this.SelType      = ASHistoryFileView.SelectionType.All;
                        Selection.objects = new UnityEngine.Object[0];
                        this.ScrollTo(0f);
                    }
                    else if (firstSelected.Previous(this.m_ExpandedArray))
                    {
                        UnityEngine.Object pptrValue = firstSelected.pptrValue;
                        this.SelectionClick(firstSelected);
                        this.FrameObject(pptrValue);
                    }
                }
                goto IL_430;
            }

            case KeyCode.DownArrow:
            {
                Event.current.Use();
                HierarchyProperty lastSelected = this.GetLastSelected();
                if (Application.platform == RuntimePlatform.OSXEditor && Event.current.command)
                {
                    this.OpenAssetSelection();
                    GUIUtility.ExitGUI();
                }
                else if (lastSelected != null)
                {
                    if (lastSelected.instanceID == this.GetLast().instanceID)
                    {
                        this.SelType      = ASHistoryFileView.SelectionType.DeletedItemsRoot;
                        Selection.objects = new UnityEngine.Object[0];
                        this.ScrollToDeletedItem(-1);
                    }
                    else if (lastSelected.Next(this.m_ExpandedArray))
                    {
                        UnityEngine.Object pptrValue2 = lastSelected.pptrValue;
                        this.SelectionClick(lastSelected);
                        this.FrameObject(pptrValue2);
                    }
                }
                goto IL_430;
            }

            case KeyCode.RightArrow:
            {
                HierarchyProperty activeSelected = this.GetActiveSelected();
                if (activeSelected != null)
                {
                    this.SetExpanded(activeSelected.instanceID, true);
                }
                goto IL_430;
            }

            case KeyCode.LeftArrow:
            {
                HierarchyProperty activeSelected2 = this.GetActiveSelected();
                if (activeSelected2 != null)
                {
                    this.SetExpanded(activeSelected2.instanceID, false);
                }
                goto IL_430;
            }

            case KeyCode.Home:
                if (this.GetFirst() != null)
                {
                    Selection.activeObject = this.GetFirst().pptrValue;
                    this.FrameObject(Selection.activeObject);
                }
                goto IL_430;

            case KeyCode.End:
                if (this.GetLast() != null)
                {
                    Selection.activeObject = this.GetLast().pptrValue;
                    this.FrameObject(Selection.activeObject);
                }
                goto IL_430;

            case KeyCode.PageUp:
                Event.current.Use();
                if (ASHistoryFileView.OSX)
                {
                    this.m_ScrollPosition.y = this.m_ScrollPosition.y - this.m_ScreenRect.height;
                    if (this.m_ScrollPosition.y < 0f)
                    {
                        this.m_ScrollPosition.y = 0f;
                    }
                }
                else
                {
                    HierarchyProperty hierarchyProperty = this.GetFirstSelected();
                    if (hierarchyProperty != null)
                    {
                        int num = 0;
                        while ((float)num < this.m_ScreenRect.height / ASHistoryFileView.m_RowHeight)
                        {
                            if (!hierarchyProperty.Previous(this.m_ExpandedArray))
                            {
                                hierarchyProperty = this.GetFirst();
                                break;
                            }
                            num++;
                        }
                        UnityEngine.Object pptrValue3 = hierarchyProperty.pptrValue;
                        this.SelectionClick(hierarchyProperty);
                        this.FrameObject(pptrValue3);
                    }
                    else if (this.GetFirst() != null)
                    {
                        Selection.activeObject = this.GetFirst().pptrValue;
                        this.FrameObject(Selection.activeObject);
                    }
                }
                goto IL_430;

            case KeyCode.PageDown:
                Event.current.Use();
                if (ASHistoryFileView.OSX)
                {
                    this.m_ScrollPosition.y = this.m_ScrollPosition.y + this.m_ScreenRect.height;
                }
                else
                {
                    HierarchyProperty hierarchyProperty2 = this.GetLastSelected();
                    if (hierarchyProperty2 != null)
                    {
                        int num2 = 0;
                        while ((float)num2 < this.m_ScreenRect.height / ASHistoryFileView.m_RowHeight)
                        {
                            if (!hierarchyProperty2.Next(this.m_ExpandedArray))
                            {
                                hierarchyProperty2 = this.GetLast();
                                break;
                            }
                            num2++;
                        }
                        UnityEngine.Object pptrValue4 = hierarchyProperty2.pptrValue;
                        this.SelectionClick(hierarchyProperty2);
                        this.FrameObject(pptrValue4);
                    }
                    else if (this.GetLast() != null)
                    {
                        Selection.activeObject = this.GetLast().pptrValue;
                        this.FrameObject(Selection.activeObject);
                    }
                }
                goto IL_430;
            }
            goto IL_44;
IL_1C6:
            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                this.OpenAssetSelection();
                GUIUtility.ExitGUI();
            }
IL_430:
            Event.current.Use();
        }