Created
October 16, 2019 09:39
-
-
Save karljj1/eaed0008bd1e48ecd7f4deed861dca79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
Author
karljj1
commented
Oct 16, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment