Created
December 14, 2013 18:33
-
-
Save yumehachi/7963001 to your computer and use it in GitHub Desktop.
Android、IOSビルドをまとめて実行
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
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
using System.IO; | |
/// <summary> | |
/// ビルド設定 | |
/// </summary> | |
/// <author> | |
/// Create by yumehachi on 2013/12/15 | |
/// </author> | |
public class Build : MonoBehaviour | |
{ | |
/// <summary> | |
/// iosとandroidのビルドを実行 | |
/// </summary> | |
[MenuItem ("BuildTool/BuildALL")] | |
static void BuildIosAndAndroid () | |
{ | |
string[] level = { | |
"Assets/Scene/SceneName.unity" | |
}; | |
string buildPath = "Build"; | |
string buildPathIOS = "Build/IOS"; | |
string buildPathAndroid = "Build/Android"; | |
string androidName = "Android.apk"; | |
if (!Directory.Exists (buildPath)) { | |
Directory.CreateDirectory (buildPath); | |
} | |
if (!Directory.Exists (buildPathIOS)) { | |
Directory.CreateDirectory (buildPathIOS); | |
} | |
if (!Directory.Exists (buildPathAndroid)) { | |
Directory.CreateDirectory (buildPathAndroid); | |
} | |
BuildOptions option = BuildOptions.Development; | |
EditorUserBuildSettings.development = true; | |
PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel8; | |
BuildPipeline.BuildPlayer (level, buildPathAndroid + "/" + androidName, | |
BuildTarget.Android, option); | |
BuildPipeline.BuildPlayer (level, buildPathIOS, | |
BuildTarget.iPhone, option); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment