@@ -86,6 +86,7 @@ float maxScale
8686 [ SerializeField ] bool [ ] m_LowResolutionForAspectRatios = new bool [ 0 ] ;
8787 [ SerializeField ] int m_XRRenderMode = 0 ;
8888 [ SerializeField ] RenderTexture m_RenderTexture ;
89+ [ SerializeField ] bool m_showToolbar = true ;
8990
9091 int m_SizeChangeID = int . MinValue ;
9192
@@ -210,7 +211,10 @@ internal void SetTargetDisplay(int id)
210211
211212 Rect GetViewInWindow ( Rect pos )
212213 {
213- return new Rect ( 0 , EditorGUI . kWindowToolbarHeight , pos . width , pos . height - EditorGUI . kWindowToolbarHeight ) ;
214+ if ( showToolbar )
215+ return new Rect ( 0 , EditorGUI . kWindowToolbarHeight , pos . width , pos . height - EditorGUI . kWindowToolbarHeight ) ;
216+
217+ return new Rect ( 0 , 0 , pos . width , pos . height ) ;
214218 }
215219
216220 Rect GetViewPixelRect ( Rect viewRectInWindow )
@@ -309,6 +313,12 @@ Rect targetInParent // Area of the render target in parent view space
309313 Vector2 gameMouseOffset { get { return - viewInWindow . position - targetInView . position ; } }
310314
311315 float gameMouseScale { get { return backingScale / m_ZoomArea . scale . y ; } }
316+
317+ private bool showToolbar
318+ {
319+ get => m_showToolbar ;
320+ set => m_showToolbar = value ;
321+ }
312322
313323 internal bool drawGizmos
314324 {
@@ -332,6 +342,7 @@ public void OnEnable()
332342 prevSizeGroupType = ( int ) currentSizeGroupType ;
333343 titleContent = GetLocalizedTitleContent ( ) ;
334344 UpdateZoomAreaAndParent ( ) ;
345+ showToolbar = ModeService . HasCapability ( ModeCapability . GameViewToolbar , true ) ;
335346
336347 ModeService . modeChanged += OnEditorModeChanged ;
337348 EditorApplication . playModeStateChanged += OnPlayModeStateChanged ;
@@ -910,6 +921,7 @@ void RepaintIfNeeded()
910921
911922 private void OnEditorModeChanged ( ModeService . ModeChangedArgs args )
912923 {
924+ showToolbar = ModeService . HasCapability ( ModeCapability . GameViewToolbar , true ) ;
913925 Repaint ( ) ;
914926 }
915927
@@ -948,7 +960,8 @@ private void OnGUI()
948960 UpdateZoomAreaAndParent ( ) ;
949961 }
950962
951- DoToolbarGUI ( ) ;
963+ if ( showToolbar )
964+ DoToolbarGUI ( ) ;
952965
953966 if ( type == EventType . MouseDown || type == EventType . MouseUp )
954967 {
0 commit comments