Skip to content

Instantly share code, notes, and snippets.

@cician
Last active December 27, 2015 17:18
Show Gist options
  • Save cician/7360936 to your computer and use it in GitHub Desktop.
Save cician/7360936 to your computer and use it in GitHub Desktop.
Transform editor rendering the original Unity's editor.
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(Transform))]
public class TransformEditorWrapper : Editor {
Editor transformEditor;
void OnEnable() {
Transform transform = target as Transform;
System.Type t = typeof(UnityEditor.EditorApplication).Assembly.GetType("UnityEditor.TransformInspector");
transformEditor = Editor.CreateEditor(transform, t);
}
public override void OnInspectorGUI() {
GUI.changed = false;
transformEditor.OnInspectorGUI();
Transform transform = target as Transform;
GUILayout.Label("WRAPPED!");
// do your stuff here...
}
void OnDisable() {
DestroyImmediate(transformEditor);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment