Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unity Inspector script to draw a circle in the SceneView
using UnityEngine;
using UnityEditor;
// replace "SpawnZone" with the class of your Script on a GameObject
[CustomEditor(typeof(SpawnZone))]
public class SpawnZoneInspector : Editor
{
// replace "SpawnZone" with the class of your Script on a GameObject
private SpawnZone myZone;
public void OnEnable ()
{
// replace "SpawnZone" with the class of your Script on a GameObject
myZone = target as SpawnZone;
}
void OnSceneGUI ()
{
// Choose a Color
Handles.color = Color.red;
// replace "SpawnZone" with the class of your Script on a GameObject
// your Class has to have a radius
Handles.DrawWireDisc (this.myZone.transform.position, Vector3.forward, this.myZone.SpawnRadius);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.