public override void OnInspectorGUI() { XmlImporter myScript = (XmlImporter)target; if (GUILayout.Button("Select File")) { myScript.fileName = EditorUtility.OpenFilePanel("Select Teardown XML file", "", "xml"); } GUILayout.Space(30); DrawDefaultInspector(); GUILayout.Space(30); if (GUILayout.Button("Import")) { myScript.import(); } }
private void drawImportDialog() { GUILayout.Label("Import Level XML", EditorStyles.boldLabel); levelXmlPath = EditorGUILayout.TextField("Level XML", levelXmlPath); if (GUILayout.Button("Select XML")) { levelXmlPath = EditorUtility.OpenFilePanel("Select Teardown XML file", "", "xml"); } GUILayout.Space(10); XmlImporter xmlImporter = new XmlImporter(); xmlImporter.fileName = levelXmlPath; if (GUILayout.Button("Import")) { xmlImporter.import(); } }