Firstborn/Assets/ModTool/ModTool.Editor.Exporting/ExporterEditorWindow.cs
Schaken-Mods 7502018d20 Adding Mod Support
There is an asset in the store I grabbed. the coding is WAY above my head, I got about half of it and integrated and adapted what I can to it. im going as far as I can with it and ill come back in a few month when I understand t better.
2023-05-13 22:01:48 -05:00

44 lines
1.2 KiB
C#

using UnityEditor;
using UnityEngine;
namespace ModTool.Editor.Exporting
{
internal class ExporterEditorWindow : EditorWindow
{
private UnityEditor.Editor exportSettingsEditor;
[MenuItem("Tools/ModTool/Export Mod")]
public static void ShowWindow()
{
ExporterEditorWindow window = GetWindow<ExporterEditorWindow>();
window.maxSize = new Vector2(385f, 295);
window.minSize = new Vector2(300f, 295);
window.titleContent = new GUIContent("Mod Exporter");
}
void OnEnable()
{
ExportSettings exportSettings = ExportSettings.instance;
exportSettingsEditor = UnityEditor.Editor.CreateEditor(exportSettings);
}
void OnDisable()
{
DestroyImmediate(exportSettingsEditor);
}
void OnGUI()
{
GUI.enabled = !EditorApplication.isCompiling && !ModExporter.isExporting && !Application.isPlaying;
exportSettingsEditor.OnInspectorGUI();
bool buttonPressed = GUILayout.Button("Export Mod", GUILayout.Height(30));
if (buttonPressed)
ModExporter.ExportMod();
}
}
}