Created
January 19, 2016 13:55
-
-
Save david-hodgetts/5f6eba8eeb3df640aa56 to your computer and use it in GitHub Desktop.
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 System.Collections; | |
[ExecuteInEditMode] | |
public class ShowMyTransforms : MonoBehaviour { | |
void OnDrawGizmos(){ | |
Gizmos.color = Color.red; | |
Gizmos.DrawLine (transform.position, transform.position + transform.right); | |
Gizmos.color = Color.blue; | |
Gizmos.DrawLine (transform.position, transform.position + transform.forward); | |
Gizmos.color = Color.green; | |
Gizmos.DrawLine (transform.position, transform.position + transform.up); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote a variant of this useful gizmo, that displays the axis only when the game object is selected; it displays also small spheres at the origin and end of the right/forward/up axis.