|
@@ -5,10 +5,10 @@ using System.IO;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
-public class BuildForAllPlatforms
|
|
|
+public class BuildForAllPlatforms : EditorWindow
|
|
|
{
|
|
|
- // private static int versionCode = 1;
|
|
|
- // private static string version = "1.0.0";
|
|
|
+ private static int versionCode = 1;
|
|
|
+ private static string version = "1.0.0";
|
|
|
private static string gameName = "MyLovelyGarden";
|
|
|
private static string companyName = "DashGame Technology Inc.";
|
|
|
private static ApiCompatibilityLevel apiCompatLevel = ApiCompatibilityLevel.NET_2_0;
|
|
@@ -24,7 +24,34 @@ public class BuildForAllPlatforms
|
|
|
private static string androidBundleIdentifier = "com.dashgame.garden";
|
|
|
private static AndroidSdkVersions androidMinSdk = AndroidSdkVersions.AndroidApiLevel16; // Jellybean;
|
|
|
|
|
|
- [MenuItem("DashGame/Player/Build Win32")]
|
|
|
+ [MenuItem("DashGame/PlayerBuilder")]
|
|
|
+ private static void ShowWindow()
|
|
|
+ {
|
|
|
+ versionCode = PlayerSettings.Android.bundleVersionCode;
|
|
|
+ version = PlayerSettings.bundleVersion;
|
|
|
+
|
|
|
+ // Get existing open window or if none, make a new one:
|
|
|
+ BuildForAllPlatforms window = (BuildForAllPlatforms)EditorWindow.GetWindow(typeof(BuildForAllPlatforms), false, "Player Builder");
|
|
|
+ window.Show();
|
|
|
+ }
|
|
|
+
|
|
|
+ void OnGUI()
|
|
|
+ {
|
|
|
+ version = EditorGUILayout.TextField("Version", version);
|
|
|
+ versionCode = int.Parse(EditorGUILayout.TextField("VersionCode", versionCode.ToString()));
|
|
|
+
|
|
|
+ if (GUILayout.Button("Android", GUILayout.Height(30)))
|
|
|
+ BuildAndroid();
|
|
|
+ if (GUILayout.Button("iOS", GUILayout.Height(30)))
|
|
|
+ BuildiOS();
|
|
|
+ if (GUILayout.Button("iOS Debug", GUILayout.Height(30)))
|
|
|
+ BuildiOSDebug();
|
|
|
+ if (GUILayout.Button("Win32", GUILayout.Height(30)))
|
|
|
+ BuildWin32();
|
|
|
+ if (GUILayout.Button("OSX 64", GUILayout.Height(30)))
|
|
|
+ BuildOSX64();
|
|
|
+ }
|
|
|
+
|
|
|
public static void BuildWin32()
|
|
|
{
|
|
|
// Get build path
|
|
@@ -39,9 +66,10 @@ public class BuildForAllPlatforms
|
|
|
BuildTarget.StandaloneWindows,
|
|
|
BuildOptions.None
|
|
|
);
|
|
|
+
|
|
|
+ UpdateInfo();
|
|
|
}
|
|
|
|
|
|
- [MenuItem("DashGame/Player/Build OSX 64")]
|
|
|
public static void BuildOSX64()
|
|
|
{
|
|
|
// Get build path
|
|
@@ -63,9 +91,10 @@ public class BuildForAllPlatforms
|
|
|
BuildTarget.StandaloneOSXIntel64,
|
|
|
BuildOptions.None
|
|
|
);
|
|
|
+
|
|
|
+ UpdateInfo();
|
|
|
}
|
|
|
|
|
|
- [MenuItem("DashGame/Player/Build iOS")]
|
|
|
public static void BuildiOS()
|
|
|
{
|
|
|
// Get build path
|
|
@@ -93,9 +122,10 @@ public class BuildForAllPlatforms
|
|
|
BuildTarget.iOS,
|
|
|
BuildOptions.Il2CPP | BuildOptions.AcceptExternalModificationsToPlayer | BuildOptions.SymlinkLibraries
|
|
|
);
|
|
|
+
|
|
|
+ UpdateInfo();
|
|
|
}
|
|
|
|
|
|
- [MenuItem("DashGame/Player/Build iOS Debug")]
|
|
|
public static void BuildiOSDebug()
|
|
|
{
|
|
|
// Get build path
|
|
@@ -123,9 +153,10 @@ public class BuildForAllPlatforms
|
|
|
|BuildOptions.AllowDebugging | BuildOptions.ConnectWithProfiler | BuildOptions.AcceptExternalModificationsToPlayer |
|
|
|
BuildOptions.SymlinkLibraries
|
|
|
);
|
|
|
+
|
|
|
+ UpdateInfo();
|
|
|
}
|
|
|
|
|
|
- [MenuItem("DashGame/Player/Build Android")]
|
|
|
public static void BuildAndroid()
|
|
|
{
|
|
|
// Get build path
|
|
@@ -158,6 +189,8 @@ public class BuildForAllPlatforms
|
|
|
BuildTarget.Android,
|
|
|
BuildOptions.None
|
|
|
);
|
|
|
+
|
|
|
+ UpdateInfo();
|
|
|
}
|
|
|
|
|
|
private static string[] GetLevelPaths()
|
|
@@ -174,4 +207,9 @@ public class BuildForAllPlatforms
|
|
|
|
|
|
return temp.ToArray();
|
|
|
}
|
|
|
+
|
|
|
+ private static void UpdateInfo(){
|
|
|
+ PlayerSettings.Android.bundleVersionCode = versionCode;
|
|
|
+ PlayerSettings.bundleVersion = version;
|
|
|
+ }
|
|
|
}
|