Created
November 22, 2019 03:33
-
-
Save x5lcfd/eaab16b9fe82b35a910ebcb79f8730e0 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
namespace EngineTools | |
{ | |
[InitializeOnLoad] | |
public class ShowFlagsWindow : Editor | |
{ | |
static ShowFlagsWindow() | |
{ | |
SceneView.onSceneGUIDelegate -= OnSceneGUI; | |
SceneView.onSceneGUIDelegate += OnSceneGUI; | |
} | |
private static void OnSceneGUI(SceneView sceneView) | |
{ | |
DrawToolMenu(sceneView); | |
} | |
private static void DrawToolMenu(SceneView sceneView) | |
{ | |
Handles.BeginGUI(); | |
GUILayout.BeginArea(new Rect(0, sceneView.position.height - 35, sceneView.position.width, 20), EditorStyles.toolbar); | |
GUILayout.BeginHorizontal(); | |
if (GUILayout.Button("ShowFlags", EditorStyles.toolbarButton, GUILayout.Width(100))) | |
{ | |
Debug.Log("test"); | |
} | |
GUILayout.EndHorizontal(); | |
GUILayout.EndArea(); | |
Handles.EndGUI(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment