Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created October 12, 2011 10:32

Revisions

  1. Emil Johansen revised this gist Oct 12, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion MyProxy.cs
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,7 @@ public MyInspector (Editor proxy)
    public void OnInspectorGUI ()
    {
    GUILayout.Label ("KAN HAZ INSPECTAR?!");
    GUILayout.Label (string.Format ("Target: {0}", proxy.target == null ? "none" : target.ToString ()));
    GUILayout.Label (string.Format ("Target: {0}", proxy.target == null ? "none" : proxy.target.ToString ()));
    }


  2. Emil Johansen created this gist Oct 12, 2011.
    60 changes: 60 additions & 0 deletions MyProxy.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    /////////////////////////////////////////////////////////////////
    // MyProxy.cs - the C# source file in your assets
    /////////////////////////////////////////////////////////////////


    using UnityEngine;
    using UnityEditor;
    using MyAssemblyNamespace;


    [CustomEditor (typeof (MyBehaviour))]
    public MyProxy : Editor
    {
    MyInspector owner;


    public MyProxy ()
    {
    owner = new MyInspector (this);
    }


    public override void OnInspectorGUI ()
    {
    owner.OnInspectorGUI ();
    }

    /* ... */
    }


    /////////////////////////////////////////////////////////////////
    // MyInspector.cs - the actual inspector code built to assembly
    /////////////////////////////////////////////////////////////////


    using UnityEngine;
    using UnityEditor;


    public class MyInspector
    {
    Editor proxy;


    public MyInspector (Editor proxy)
    {
    this.proxy = proxy;
    }


    public void OnInspectorGUI ()
    {
    GUILayout.Label ("KAN HAZ INSPECTAR?!");
    GUILayout.Label (string.Format ("Target: {0}", proxy.target == null ? "none" : target.ToString ()));
    }


    /* ... */
    }