Created
December 25, 2015 22:56
-
-
Save unitycoder/b8759c19c0129a82ae48 to your computer and use it in GitHub Desktop.
Custom DrawGizmos for scripts attached to gameobjects in Editor
This file contains hidden or 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; | |
public class DrawGizmos | |
{ | |
[DrawGizmo(GizmoType.Active)] // there are also other options for gizmotypes | |
static void DrawMyGizmo(MyScript script, GizmoType gizmoType) // set MyScript as your script class/name | |
{ | |
Debug.DrawRay(script.transform.position, script.transform.up*10, Color.red); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment