- Home /
Question by
Deadcow_ · Apr 06, 2015 at 09:55 AM ·
c#editorcustom-inspector
DrawDefaultInspector of another script in custom inspector
Okay, I don't think this is reachable, but it'll be good to be sure :)
For example I have BaseScript and ChildScript, in custom inspector of base i get all ChildScripts:
var childs = (target as BaseScript)
.GetComponentsInChildren<ChildScripts>();
And then I want to iterate through this collection of childs in OnInspectorGUI of BaseScript custom inspector and call DrawDefaultInspector for each child. Hope it makes sense :) Thanks
Comment
Best Answer
Answer by frarees · Apr 09, 2015 at 03:11 PM
For every object, you could do:
Editor e = Editor.CreateEditor (child, null);
e.DrawDefaultInspector ();