Esempio n. 1
0
 /// <summary>
 /// Repaints the EditorWindow if a repaint has been requested.
 /// </summary>
 /// <param name="window">The window to repaint.</param>
 public static void RepaintIfRequested(this EditorWindow window)
 {
     if (GUIHelper.RepaintRequested)
     {
         EditorTimeHelper.Time.Update();
         window.Repaint();
         if (Event.current.type == EventType.Repaint)
         {
             EditorTimeHelper.RemoveOldWindowTimeHelper();
             GUIHelper.ClearRepaintRequest();
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Repaints the editor if a repaint has been requested. If the currently rendering window is not an InspectorWindow, Repaint() will be called on the current window as well.
        /// </summary>
        /// <param name="editor">The editor to repaint.</param>
        public static void RepaintIfRequested(this Editor editor)
        {
            EditorTimeHelper.Time.Update();
            if (GUIHelper.RepaintRequested)
            {
                editor.Repaint();

                if (CurrentWindow != null && CurrentWindow.GetType() != inspectorWindowType)
                {
                    CurrentWindow.Repaint();
                }

                if (Event.current.type == EventType.Repaint)
                {
                    EditorTimeHelper.RemoveOldWindowTimeHelper();
                    GUIHelper.ClearRepaintRequest();
                }
            }
        }