Created
July 22, 2016 10:50
-
-
Save Elideb/c0800e4dc31ec67836404a6d2ca587cc to your computer and use it in GitHub Desktop.
Generating builds from scripts in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MenuItem("Builds/Win 64bits/DRM Free")] | |
public static void BuildWin64NoDRM() { | |
string[] levels = new string[] { | |
"Assets/Test_Levels/LoadingScreen.unity", | |
"Assets/Test_Levels/Main_Menu.unity", | |
"Assets/Test_Levels/Credits.unity", | |
"Assets/Test_Levels/Tutorial.unity", | |
"Assets/Test_Levels/Test_Level.unity", | |
"Assets/Test_Levels/Death_Menu.unity" | |
}; | |
UnityEditor.PlayerSettings.runInBackground = false; | |
string message = BuildPipeline.BuildPlayer( | |
levels, | |
"../Builds/DRMFree/Win64/GameTitle.exe", | |
BuildTarget.StandaloneWindows64, | |
BuildOptions.ShowBuiltPlayer); | |
if (string.IsNullOrEmpty(message)) | |
UnityEngine.Debug.Log("Win64 build complete"); | |
else | |
UnityEngine.Debug.LogError("Error building Win64:\n" + message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment