I’ve been trying to use the Handle class to draw lines in the editor with no success. I’ve placed the following script in the Assets/Editor folder
using UnityEditor;
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class LineDrawer : MonoBehaviour {
public void OnSceneGUI()
{
Handles.BeginGUI();
Handles.color = Color.red;
Handles.DrawLine( Vector3.zero, Vector3.one * 10);
Handles.EndGUI();
}
}
I’ve also tried using OnGUI instead of OnSceneGUI. But no line ever shows up in my scene.