/// <summary>
        /// Renders panels to editor window (called by OnGUI).
        /// </summary>
        /// <param name="windowRect">Window rect to render within.</param>
        public void Render(Rect windowRect)
        {
            // TODO: Add transparent overlay over old panel so buttons don't work
            if (transitioning)
            {
                float posPerc = transitionCurve.Evaluate(transitionPerc);

                if (transitionPerc >= 1)
                {
                    transitioning  = false;
                    transitionPerc = 0;
                    oldPanel       = null;
                }

                transitionPerc = Math.Min(transitionPerc + transitionSpeed, 1);

                Rect newPanelRect = default(Rect);
                Rect oldPanelRect = default(Rect);

                if (transitionDir == PanelDirection.Left)
                {
                    float posPerc1 = posPerc;
                    newPanelRect = new Rect((posPerc1 - 1) * windowRect.width, 0, windowRect.width, windowRect.height);
                    oldPanelRect = new Rect(posPerc * windowRect.width, 0, windowRect.width, windowRect.height);
                }
                else
                {
                    newPanelRect = new Rect((1 - posPerc) * windowRect.width, 0, windowRect.width, windowRect.height);
                    oldPanelRect = new Rect(-posPerc * windowRect.width, 0, windowRect.width, windowRect.height);
                }

                RenderPanel(oldPanelRect, oldPanel);
                RenderPanel(newPanelRect, currentPanel);
            }
            else
            {
                RenderPanel(windowRect, currentPanel);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PanelManager"/> class.
 /// </summary>
 /// <param name="window">Reference to the Editor Window class.</param>
 public PanelManager(MainWindow window)
 {
     PanelStack   = new List <PanelBase>();
     currentPanel = new WelcomePanel(window);
 }