diff --git a/Assets/Scripts/Editor/BuildScript.cs b/Assets/Scripts/Editor/BuildScript.cs index 6eefe84..872c8fe 100644 --- a/Assets/Scripts/Editor/BuildScript.cs +++ b/Assets/Scripts/Editor/BuildScript.cs @@ -1,5 +1,11 @@ using UnityEditor; using UnityEngine; +using System; +using System.IO; +using System.IO.Compression; +using System.Collections; +using System.Text; + public class BuildSrcipt { @@ -9,26 +15,35 @@ public class BuildSrcipt [MenuItem("Build/Build WebGL")] static void BuildWebGL() { - BuildPipeline.BuildPlayer(scenes, "./" + name + "_Web/" + name, BuildTarget.WebGL, BuildOptions.None); + BuildPlatform("Web", BuildTarget.WebGL); } [MenuItem("Build/Build Windows")] static void BuildWindows() { - BuildPipeline.BuildPlayer(scenes, "./" + name + "_Windows/" + name, BuildTarget.StandaloneWindows64, BuildOptions.None); + BuildPlatform("Windows", BuildTarget.StandaloneWindows64); } [MenuItem("Build/Build Linux")] static void BuildLinux() { - BuildPipeline.BuildPlayer(scenes, "./" + name + "_Linux/" + name, BuildTarget.StandaloneLinux64, BuildOptions.None); + //System.Diagnostics.Process.Start("mkdir /home/piegames/Documents/GitHub/Bildschirmflausch.LD41/teghsfdt"); + //Debug.Log("fdsghjk"); + BuildPlatform("Linux", BuildTarget.StandaloneLinux64); } - [MenuItem("Build/Build All")] - public static void BuildAll() - { + [MenuItem("Build/Build All")] + public static void BuildAll() + { BuildLinux(); BuildWindows(); BuildWebGL(); - } + } + + public static void BuildPlatform(String platformName, BuildTarget target) { + Directory.Delete("./" + name + "_" + platformName, true); + File.Delete("./Build/DungeonDrifter_" + platformName + ".zip"); + BuildPipeline.BuildPlayer(scenes, "./" + name + "_" + platformName + "/" + name, target, BuildOptions.None); + //System.Diagnostics.Process.Start("zip -r Build/DungeonDrifter_" + platformName + ".zip " + platformName + "_" + platformName); + } } diff --git a/Assets/Scripts/WebGLBuilder.cs b/Assets/Scripts/WebGLBuilder.cs deleted file mode 100644 index b26cf9e..0000000 --- a/Assets/Scripts/WebGLBuilder.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; - -public class WebGLBuilder : MonoBehaviour -{ - public static void BuildWebGL() - { - string[] scenes = { "Assets/main.unity" }; - Debug.Log("BLUUUUUUUUUUUUUU"); - BuildSrcipt.BuildAll(); - //UnityEditor.BuildPlayerOptions options = new BuildPlayerOptions(); - } -} \ No newline at end of file diff --git a/Assets/Scripts/WebGLBuilder.cs.meta b/Assets/Scripts/WebGLBuilder.cs.meta deleted file mode 100644 index 4a0d785..0000000 --- a/Assets/Scripts/WebGLBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f78523fb1f3ae4a50a0a58566e475bf0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/build.sh b/build.sh deleted file mode 100755 index f8670d1..0000000 --- a/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -unity-editor-beta -executeMethod Editor.BuildScript.BuildAll -#unity-editor-beta -quit -batchmode -buildLinux64Player ./DungeonDrifter_Linux/DungeonDrifter -#unity-editor-beta -quit -batchmode -buildWindows64Player ./DungeonDrifter_Windows/DungeonDrifter - -#zip -r Build/DungeonDrifter_Windows.zip DungeonDrifter_Windows -#zip -r Build/DungeonDrifter_Linux.zip DungeonDrifter_Linux -#zip -r Build/DungeonDrifter_Web.zip DungeonDrifter_Web diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..6b2f705 --- /dev/null +++ b/package.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#unity-editor-beta -executeMethod Editor.BuildScript.BuildAll +#unity-editor-beta -quit -batchmode -buildLinux64Player ./DungeonDrifter_Linux/DungeonDrifter +#unity-editor-beta -quit -batchmode -buildWindows64Player ./DungeonDrifter_Windows/DungeonDrifter + +zip -r Build/DungeonDrifter_Windows.zip DungeonDrifter_Windows +zip -r Build/DungeonDrifter_Linux.zip DungeonDrifter_Linux +zip -r Build/DungeonDrifter_Web.zip DungeonDrifter_Web