Search Unity

[SOLVED] Recreate Custom Inspector within Custom Inspector

Discussion in 'Immediate Mode GUI (IMGUI)' started by RyFridge, Aug 24, 2016.

  1. RyFridge

    RyFridge

    Joined:
    Apr 7, 2014
    Posts:
    52
    Hi there,
    I am have a rather simple problem:
    I have foldouts of other Components inside my Custom Inspector, like an overview of multiple Inspectors.

    Right now I am listing them all in a for loop like this:
    Code (CSharp):
    1. Editor e = Editor.CreateEditor (myListOfBehaviours[i], null);
    2. e.DrawDefaultInspector ();
    It works alright, but how can I show another scripts Custom Inspector (not the Default one)?

    Thanks! :)


    EDIT (solved):

    Okay, I worked it out myself. For everybody interested, this is how you can do it:
    Code (CSharp):
    1. Editor e = Editor.CreateEditor (myListOfBehaviours[i], null);
    2. e.OnInspectorGUI(); // custom inspector with default inspector fallback
     
    Last edited: Aug 25, 2016