Created
November 11, 2014 11:29
-
-
Save DomDomHaas/73a5c22c66c18e71a158 to your computer and use it in GitHub Desktop.
Unity Inspector script to draw a circle in the SceneView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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