// Functions public static bool BuildSLN(string buildDirectory, bool showConfDlg = true) { // Use BuildSLNUtilities to create the SLN bool buildSuccess = false; BuildSLNUtilities.PerformBuild(new BuildSLNUtilities.BuildInfo() { // These properties should all match what the Standalone.proj file specifies OutputDirectory = buildDirectory, Scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(scene => scene.path), BuildTarget = BuildTarget.WSAPlayer, WSASdk = WSASDK.UWP, WSAUWPBuildType = WSAUWPBuildType.D3D, // Configure a post build action that will compile the generated solution PostBuildAction = (buildInfo, buildError) => { if (!string.IsNullOrEmpty(buildError)) { EditorUtility.DisplayDialog(PlayerSettings.productName + " WindowsStoreApp Build Failed!", buildError, "OK"); } else { if (showConfDlg) { EditorUtility.DisplayDialog(PlayerSettings.productName, "Build Complete", "OK"); } buildSuccess = true; } } }); return(buildSuccess); }
public static bool BuildSLN(string buildDirectory, bool showDialog = true) { // Use BuildSLNUtilities to create the SLN bool buildSuccess = false; if (CheckBuildScenes() == false) { return(false); } var buildInfo = new BuildInfo { // These properties should all match what the Standalone.proj file specifies OutputDirectory = buildDirectory, Scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(scene => scene.path), BuildTarget = BuildTarget.WSAPlayer, WSASdk = WSASDK.UWP, WSAUWPBuildType = EditorUserBuildSettings.wsaUWPBuildType, WSAUwpSdk = EditorUserBuildSettings.wsaUWPSDK, // Configure a post build action that will compile the generated solution PostBuildAction = (innerBuildInfo, buildError) => { if (!string.IsNullOrEmpty(buildError)) { EditorUtility.DisplayDialog(PlayerSettings.productName + " WindowsStoreApp Build Failed!", buildError, "OK"); } else { if (showDialog) { if (!EditorUtility.DisplayDialog(PlayerSettings.productName, "Build Complete", "OK", "Build AppX")) { BuildAppxFromSLN( PlayerSettings.productName, BuildDeployPrefs.MsBuildVersion, BuildDeployPrefs.ForceRebuild, BuildDeployPrefs.BuildConfig, BuildDeployPrefs.BuildPlatform, BuildDeployPrefs.BuildDirectory, BuildDeployPrefs.IncrementBuildVersion); } } buildSuccess = true; } } }; BuildSLNUtilities.RaiseOverrideBuildDefaults(ref buildInfo); BuildSLNUtilities.PerformBuild(buildInfo); return(buildSuccess); }