Skip to content

Instantly share code, notes, and snippets.

@Novack
Forked from karljj1/HideSceneViewToolbar.s
Created October 16, 2019 12:44
Show Gist options
  • Select an option

  • Save Novack/f479feb8ea60486dbb9ea5a14babf071 to your computer and use it in GitHub Desktop.

Select an option

Save Novack/f479feb8ea60486dbb9ea5a14babf071 to your computer and use it in GitHub Desktop.
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class HideSceneToolbar
{
[MenuItem("Test/Hide the scene toolbar")]
static void Hide()
{
var sceneViews = Resources.FindObjectsOfTypeAll<SceneView>();
foreach(var sv in sceneViews)
{
var toolbar = new VisualElement();
toolbar.style.backgroundColor = new Color(0.2196079f, 0.2196079f, 0.2196079f);
toolbar.style.height = 20;
toolbar.BringToFront();
sv.rootVisualElement.Clear();
sv.rootVisualElement.Insert(0, toolbar);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment