Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

Commit

Permalink
Add auto-building for the mod
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinlacewell committed Apr 22, 2019
1 parent 79217e3 commit edaf46e
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 4 deletions.
8 changes: 8 additions & 0 deletions ExampleMod/Assets/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions ExampleMod/Assets/Editor/Builder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using UnityEngine;
using MultiMod.Editor;

class Builder
{
static void PerformBuild()
{
Debug.Log("### BUILDING ###");
ExporterEditorWindow.ExportMod();
}
}
11 changes: 11 additions & 0 deletions ExampleMod/Assets/Editor/Builder.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ExampleMod/Assets/MultiMod/Editor/MultiMod.Cecil.dll
Binary file not shown.
Binary file modified ExampleMod/Assets/MultiMod/Editor/MultiMod.Editor.dll
Binary file not shown.
Binary file modified ExampleMod/Assets/MultiMod/MultiMod.Interface.dll
Binary file not shown.
Binary file modified ExampleMod/Assets/MultiMod/MultiMod.Shared.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion ExampleMod/Assets/MultiMod/Resources/ExportSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ MonoBehaviour:
_author: MultiMod
_description:
_name: ExampleMod
_outputDirectory: S:/SteamLibrary/steamapps/common/Risk of Rain 2/BepInEx/plugins/multimod/mods
_outputDirectory: B:/RoR2/MultiMod/build/
_version: 0.0.1
_prefab: {fileID: 6496937122687186768, guid: 5eb8811b29cc7bf4ca0d5bd61dc1222a, type: 3}
8 changes: 7 additions & 1 deletion MultiMod/MultiMod.Editor/ExporterEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace MultiMod.Editor
{
internal class ExporterEditorWindow : EditorWindow
public class ExporterEditorWindow : EditorWindow
{
private EditorScriptableSingleton<ExportSettings> exportSettings;
private UnityEditor.Editor exportSettingsEditor;
Expand Down Expand Up @@ -43,5 +43,11 @@ private void OnGUI()
if (buttonPressed)
Export.ExportMod(exportSettings.instance);
}

public static void ExportMod()
{
var singleton = new EditorScriptableSingleton<ExportSettings>();
Export.ExportMod(singleton.instance);
}
}
}
3 changes: 3 additions & 0 deletions build-all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
msbuild build.proj
call build-package.bat
call build-mod.bat
1 change: 1 addition & 0 deletions build-mod.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unity.exe -batchmode -nographics -projectPath ExampleMod -disable-assembly-updater -executeMethod Builder.PerformBuild -quit
1 change: 1 addition & 0 deletions build-package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unity.exe -batchmode -nographics -projectPath ExampleMod -exportPackage "Assets" "%~dp0\build\examplemod.unitypackage" -quit
2 changes: 0 additions & 2 deletions build.bat

This file was deleted.

0 comments on commit edaf46e

Please sign in to comment.