Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Possible to draw the default UI of a referenced Monobehaviour within the referencer's inspector?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Invertex, Aug 12, 2017.

  1. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,544
    I have a component that has a couple references to other components elsewhere on my characters, I want to be able to draw the inspector of those referenced components within this script so my team can modify the components from one location, but I can't seem to find a way to do this.

    Any help would be much appreciated!
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,686
    Code (csharp):
    1. var referencedComponentEditor = Editor.CreateEditor(referencedComponent);
    2. referencedComponentEditor.OnInspectorGUI();