How the beep, is Extending the SceneView Working?!

Hi there…

i tried to extend the Scene View of the Unity Editor today. And got stuck in a problem - NOTHING is shown…
this is my script right now:

using UnityEditor;
using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class RTM_SysScene : Editor{
	
	void OnSceneGUI(){
		Handles.BeginGUI(new Rect(0, 0, Screen.width, Screen.height));
 			GUILayout.Label("Test");
		Handles.EndGUI();
	}
}

What i want:

1st: No Script attaching to a GO
2nd: Showing a Label (later Positions…etc) as 2D GUI Element on the Scene view
3rd: Updating the Label as something changes

What it should be later:
Later i want to move a Box of Lines to the mouse position in the Scene View, according to a grid (tile mapper). And create a GO at the click position.

My problem:
How to do Step 1 and 2? My Script shows nothing… and i´m nearly despairing at this. The reference and docs are not really helpful…
How can i show a 2D label (or other GUI Element) on the Scene View - Like the lightmap, Occlusion or navmesh Widget :confused:

Hi,

Two things you’ll need to do:

1.) “Connect” your script with the type you want to support by adding [CustomInspector(typeof(MyCustomScriptType))] to the class (replace MyCustomScriptType with the your component’s class.
2.) Place the script in a folder called “Editor” if you havn’t already

Jake

using UnityEditor;
using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
[CustomEditor(typeof(RTM_SysScene))]
public class RTM_SysScene : Editor{
	
	void OnSceneGUI(){
		Handles.Label(Camera.main.transform.position + Vector3.forward.normalized * 5, "Test");
	}
}

This code shows the Handles.Label… But when i want to use Handles.BeginGUI → GUILayout → Handles.EndGUI… nothing is shown…

The editor functionality has to be in a different script, placed in a folder named editor.