I have a custom editor script with OnSceneGUI and some GUI labels and buttons which all work nicely. However when I select a different object in the scene the GUI is no longer visible. How can I keep it so the GUI is always visible on the sceneview?
This is the answer, from the comments:
using UnityEditor;
public class MyCustomGUI {
[MenuItem("Tools/ShowMyCustomGUI")]
public static void InitGUI() {
MyCustomGUI MCG = new MyCustomGUI();
SceneView.onSceneGUIDelegate += MCG.RenderSceneGUI;
}
public void RenderSceneGUI(SceneView sceneview) {
//Scene gui stuff
}
}