private void DrawHistoryGUI()
        {
            scrollView = EditorGUILayout.BeginScrollView(scrollView, false, false);

            showSettings = EditorGUILayout.BeginFoldoutHeaderGroup(showSettings, "Settings");
            if (showSettings)
            {
                using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope())
                {
                    int maximumHistory = EditorGUILayout.IntField("Maximum History Items", HistoryPanelCore.MaximumHistoryItems);
                    if (changeCheckScope.changed)
                    {
                        HistoryPanelCore.SetMaximumHistory(maximumHistory);
                    }
                }
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            using (new EditorGUILayout.VerticalScope("Box"))
            {
                showHistory = EditorGUILayout.BeginFoldoutHeaderGroup(showHistory, "History");
                if (showHistory)
                {
                    EditorGUIUtility.SetIconSize(new Vector2(16, 16));

                    EditorGUI.indentLevel++;
                    for (int i = 0; i < HistoryPanelCore.history.SelectionData.Count; i++)
                    {
                        SelectionData selectionData =
                            HistoryPanelCore.history.SelectionData[i];

                        if (!selectionData.IsValid)
                        {
                            continue;
                        }

                        DrawSelectionData(selectionData, i, HistoryPanelCore.history.PointInTime);
                    }

                    EditorGUI.indentLevel--;
                }

                EditorGUILayout.EndFoldoutHeaderGroup();
            }
            EditorGUILayout.EndScrollView();
        }
Esempio n. 2
0
 public void Back()
 {
     if (pointInTime == 0)
     {
         return;
     }
     for (int i = pointInTime - 1; i >= 0; i--)
     {
         SelectionData data = selectionData[i];
         if (!data.IsValid)
         {
             continue;
         }
         pointInTime     = i;
         movingInHistory = true;
         data.Select();
         break;
     }
 }