Advertisement
napland

Show Local Axis

Jul 30th, 2016
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class ShowLocalAxis : MonoBehaviour
  4. {
  5.     [HideInInspector]
  6.     public bool destroyWhenSafe = false;
  7.  
  8.     [Range(1f,100f)]
  9.     public float handleLength = 10f;
  10.  
  11.     public void OnDrawGizmos()
  12.     {
  13.         Gizmos.matrix = transform.localToWorldMatrix;
  14.         Gizmos.color = Color.blue;
  15.         Gizmos.DrawLine(Vector3.zero, Vector3.forward * handleLength);
  16.         Gizmos.color = Color.red;
  17.         Gizmos.DrawLine(Vector3.zero, Vector3.right * handleLength);
  18.         Gizmos.color = Color.yellow;
  19.         Gizmos.DrawLine(Vector3.zero, Vector3.up* handleLength);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement