- Home /
Question by
Skegon · Sep 13, 2018 at 02:53 PM ·
guieditoreditorwindowgizmos
Using Handles in EditorWindow
Hey!
I'm trying to make a tool for assisting my level designer. I want to make an EditorWindow, that while open and running (toggle button) does some analysis on the level and draws handles. (Lines and labels basically). Everything runs just fine code wise, but no handles are being drawn in the scene view.
The structure I have atm. is:
public class TrackAnalyser : EditorWindow {
void OnEnable() {
SceneView.onSceneGUIDelegate += OnSceneGUI;
}
void OnDisable() {
SceneView.onSceneGUIDelegate -= OnSceneGUI;
}
void OnGUI() {
//Generate GUI and set running state if button is pressed
}
void OnSceneGUI(SceneView sceneview) {
//Handles calls like these
Handles.color = Color.cyan;
Handles.DrawAAPolyLine(EditorGUIUtility.whiteTexture, 7, endLeft, endRight);
Handles.Label(position, size, style);
}
}
Comment