SHARE
TWEET

Show Local Axis

napland Jul 30th, 2016 204 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top