Advertisement
napland

ShowLocalAxisInspector

Jul 30th, 2016
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. [CustomEditor(typeof(ShowLocalAxis))]
  5. public class ShowLocalAxisInspector : Editor
  6. {
  7.     public override void OnInspectorGUI()
  8.     {
  9.         base.DrawDefaultInspector();
  10.  
  11.         ShowLocalAxis showRotated = (ShowLocalAxis)target;
  12.         if (showRotated.destroyWhenSafe && Event.current.type == EventType.Repaint)
  13.         {
  14.             DestroyImmediate(showRotated);
  15.             return;
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement