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))
{
Object pptrValue = firstSelected.pptrValue;
this.SelectionClick(firstSelected);
this.FrameObject(pptrValue);
}
}
else
{
this.SelType = SelectionType.All;
Selection.objects = new 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 Object[0];
this.ScrollToDeletedItem(-1);
}
else if (lastSelected.Next(this.m_ExpandedArray))
{
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;
}
}
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;
}
}
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();
}