Skip to content

Instantly share code, notes, and snippets.

@DomDomHaas
Created November 11, 2014 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DomDomHaas/73a5c22c66c18e71a158 to your computer and use it in GitHub Desktop.
Save DomDomHaas/73a5c22c66c18e71a158 to your computer and use it in GitHub Desktop.
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