Skip to content

Commit

Permalink
Unity 2018.1 updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaser324 committed Apr 25, 2018
1 parent 8dfd950 commit e600119
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Editor/Build/BuildProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,15 @@ private static bool BuildPlayer(string notification, BuildReleaseType releaseTyp

// Build player.
FileUtil.DeleteFileOrDirectory(buildPath);
string error = BuildPipeline.BuildPlayer(releaseType.sceneList.GetSceneFileList(), Path.Combine(buildPath, exeName), architecture.target, options);

string error = "";
#if UNITY_2018_1_OR_NEWER
UnityEditor.Build.Reporting.BuildReport buildReport = BuildPipeline.BuildPlayer(releaseType.sceneList.GetSceneFileList(), Path.Combine(buildPath, exeName), architecture.target, options);
if (buildReport.summary.result == UnityEditor.Build.Reporting.BuildResult.Failed)
error = buildReport.summary.totalErrors + " occurred.";
#else
error = BuildPipeline.BuildPlayer(releaseType.sceneList.GetSceneFileList(), Path.Combine(buildPath, exeName), architecture.target, options);
#endif
if (!string.IsNullOrEmpty(error))
{
success = false;
Expand Down
4 changes: 4 additions & 0 deletions Editor/Build/Platform/BuildAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ public override void ApplyVariant()

private void SetDeviceType(string key)
{
#if UNITY_2018_1_OR_NEWER
PlayerSettings.Android.targetArchitectures = (AndroidArchitecture)System.Enum.Parse(typeof(AndroidArchitecture), key);
#else
PlayerSettings.Android.targetDevice = (AndroidTargetDevice)System.Enum.Parse(typeof(AndroidTargetDevice), key);
#endif
}

private void SetTextureCompression(string key)
Expand Down

0 comments on commit e600119

Please sign in to comment.