UnityEditor.HostView.BeginOffsetArea C# (CSharp) Method

BeginOffsetArea() public static method

public static BeginOffsetArea ( Rect screenRect, GUIContent content, GUIStyle style ) : void
screenRect UnityEngine.Rect
content UnityEngine.GUIContent
style UnityEngine.GUIStyle
return void
        public static void BeginOffsetArea(Rect screenRect, GUIContent content, GUIStyle style)
        {
            GUILayoutGroup group = EditorGUILayoutUtilityInternal.BeginLayoutArea(style, typeof(GUILayoutGroup));
            if (Event.current.type == EventType.Layout)
            {
                group.resetCoords = false;
                group.minWidth = group.maxWidth = screenRect.width + 1f;
                group.minHeight = group.maxHeight = screenRect.height + 2f;
                group.rect = Rect.MinMaxRect(-1f, -1f, group.rect.xMax, group.rect.yMax - 10f);
            }
            GUI.BeginGroup(screenRect, content, style);
        }

Usage Example

示例#1
0
 public void InvokeOnGUI(Rect onGUIPosition)
 {
     if (Unsupported.IsDeveloperMode() && this.actualView != null && Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.F5)
     {
         this.Reload(this.actualView);
     }
     else
     {
         base.DoWindowDecorationStart();
         GUIStyle gUIStyle = "dockareaoverlay";
         if (this.actualView is GameView)
         {
             GUI.Box(onGUIPosition, GUIContent.none, gUIStyle);
         }
         HostView.BeginOffsetArea(new Rect(onGUIPosition.x + 2f, onGUIPosition.y + 17f, onGUIPosition.width - 4f, onGUIPosition.height - 17f - 2f), GUIContent.none, "TabWindowBackground");
         EditorGUIUtility.ResetGUIState();
         bool flag = false;
         try
         {
             this.Invoke("OnGUI");
         }
         catch (TargetInvocationException ex)
         {
             if (ex.InnerException is ExitGUIException)
             {
                 flag = true;
             }
             throw;
         }
         finally
         {
             if (!flag)
             {
                 if (this.actualView != null && this.actualView.m_FadeoutTime != 0f && Event.current != null && Event.current.type == EventType.Repaint)
                 {
                     this.actualView.DrawNotification();
                 }
                 HostView.EndOffsetArea();
                 EditorGUIUtility.ResetGUIState();
                 base.DoWindowDecorationEnd();
                 if (Event.current.type == EventType.Repaint)
                 {
                     gUIStyle.Draw(onGUIPosition, GUIContent.none, 0);
                 }
             }
         }
     }
 }
All Usage Examples Of UnityEditor.HostView::BeginOffsetArea