SHARE
TWEET

ShowLocalAxisInspector

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