-
-
Save Novack/f479feb8ea60486dbb9ea5a14babf071 to your computer and use it in GitHub Desktop.
This file contains hidden or 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); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment