You cannot force Unity3Dyour inspector to draw anywhere else than the inspector window.
You can manually install BtwEditor using the Editor.CreateEditor method . Since you are showing a user inspector, it must be created to create it manually from the method Window.OnGUIand use the public OnInspectorGUIeditor method to draw the editor inside your window.
, script CustomScript GameObject Editor CustomScriptEditor, , GameObject , EditorWindow:
using UnityEditor;
using UnityEngine;
public class TestWindow : EditorWindow
{
[MenuItem ("Window/Editor Window Test")]
static void Init ()
{
TestWindow window = (TestWindow)EditorWindow.GetWindow (typeof (TestWindow));
}
void OnGUI () {
GameObject sel = Selection.activeGameObject;
CustomScript targetComp = sel.GetComponent<CustomScript>();
if (targetComp != null)
{
var editor = Editor.CreateEditor(targetComp);
editor.OnInspectorGUI();
}
}
}