UnityEditor.HierarchyProperty.Previous C# (CSharp) Method

Previous() private method

private Previous ( int expanded ) : bool
expanded int
return bool
        public extern bool Previous(int[] expanded);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

        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();
        }
All Usage Examples Of UnityEditor.HierarchyProperty::Previous