public void Begin(Vector2 size, bool drawGUI = false) { if (Event.current.type != EventType.Layout) { var p = GUIUtility.ScreenToGUIPoint(this.screenPos); this.areaRect = new Rect(p, this.areaRect.size); } this.areaRect = new Rect(this.areaRect.position, size); GUIHelper.BeginIgnoreInput(); GUILayout.BeginArea(this.areaRect, SirenixGUIStyles.None); if (Event.current.type == EventType.Repaint) { this.prev = RenderTexture.active; if (this.target != null) { RenderTexture.ReleaseTemporary(this.target); } this.target = RenderTexture.GetTemporary(Screen.width, Screen.height, 0); RenderTexture.active = this.target; GL.Clear(false, true, new Color(0, 0, 0, 0)); } }
public void Begin(Vector2 size, bool drawGUI = false) { this.drawGUI = drawGUI; if (this.drawGUI) { return; } if (Event.current.type != EventType.Layout) { var p = GUIUtility.ScreenToGUIPoint(this.screenPos); this.areaRect = new Rect(p.x, p.y, size.x, size.y); } GUIHelper.BeginIgnoreInput(); GUILayout.BeginArea(this.areaRect, SirenixGUIStyles.None); }
/// <summary> /// Not yet documented. /// </summary> public void Begin(Vector2 size, bool drawGUI = false) { if (Event.current.type == EventType.Repaint) { this.offset = GUIClipInfo.TopRect.position; } this.drawGUI = drawGUI; if (this.drawGUI) { return; } if (this.ignoreInput) { GUIHelper.BeginIgnoreInput(); } GUILayout.BeginArea(new Rect(GUIClipInfo.VisibleRect.position, size), SirenixGUIStyles.None); if (Event.current.type == EventType.Repaint) { if (this.tooltipRenderTexture != null) { RenderTexture.ReleaseTemporary(this.tooltipRenderTexture); } var texSize = GUIHelper.CurrentWindow.position.size + new Vector2(GUIHelper.CurrentWindowBorderSize.horizontal, GUIHelper.CurrentWindowBorderSize.vertical); this.prevActiveRenderTexture = RenderTexture.active; this.tooltipRenderTexture = RenderTexture.GetTemporary((int)texSize.x, (int)texSize.y, 0); this.tooltipRenderTexture.filterMode = FilterMode.Point; this.tooltipRenderTexture.wrapMode = TextureWrapMode.Clamp; RenderTexture.active = this.tooltipRenderTexture; GL.Clear(false, true, new Color(1, 1, 1, 0)); } }