Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Merge pull request #7 from spatialos/2.0.0
Browse files Browse the repository at this point in the history
Upgrade to use Unity SDK v2.0.0
  • Loading branch information
oblm committed Jun 12, 2018
2 parents 1f28b5b + 9eacb71 commit fccbefb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,7 @@ private static void SwapInList<T>(IList<T> list, int indexA, int indexB)

private static IDisposable IndentLevelScope(int increment)
{
#if UNITY_2017_3_OR_NEWER
return new EditorGUI.IndentLevelScope(increment);
#else
return new FallbackIndentLevelScope(increment);
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ namespace Improbable.Unity.MinimalBuildSystem.Configuration
{
public class WorkerBuildData
{
internal const BuildTarget OSXBuildTarget =
#if UNITY_2017_3_OR_NEWER
BuildTarget.StandaloneOSX;
#else
BuildTarget.StandaloneOSXIntel64;
#endif
internal const BuildTarget OSXBuildTarget = BuildTarget.StandaloneOSX;

private readonly WorkerPlatform workerPlatform;
private readonly BuildTarget buildTarget;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ internal static PlayerBuildConfiguation Generate()
Targets = new List<string>
{
BuildTarget.StandaloneWindows.ToString(),
#if UNITY_2017_3_OR_NEWER
BuildTarget.StandaloneOSX.ToString()
#else
BuildTarget.StandaloneOSXIntel64.ToString()
#endif
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
using Improbable.Unity.EditorTools.Util;
using Improbable.Unity.Util;
using UnityEditor;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
using UnityEngine;

namespace Improbable.Unity.EditorTools.Build
Expand Down Expand Up @@ -51,15 +54,6 @@ private static BuildTarget ToRuntimePlatform(string platform)
if (platform.ToLower() != "current")
{
var value = (BuildTarget) Enum.Parse(typeof(BuildTarget), platform);
#if UNITY_2017_3_OR_NEWER
#pragma warning disable 618
if (value == BuildTarget.StandaloneOSXIntel64)
{
Debug.LogWarningFormat("{0} is deprecated and will be removed. Please update {1} to use {2} instead.", BuildTarget.StandaloneOSXIntel64, UnityPlayerBuilders.PlayerConfigurationFilePath, BuildTarget.StandaloneOSX);
value = BuildTarget.StandaloneOSX;
}
#pragma warning restore 618
#endif
return value;
}

Expand All @@ -73,11 +67,7 @@ internal static BuildTarget CurrentPlatform()
case RuntimePlatform.WindowsEditor:
return BuildTarget.StandaloneWindows;
case RuntimePlatform.OSXEditor:
#if UNITY_2017_3_OR_NEWER
return BuildTarget.StandaloneOSX;
#else
return BuildTarget.StandaloneOSXIntel64;
#endif
case RuntimePlatform.LinuxEditor:
return BuildTarget.StandaloneLinux64;
default:
Expand Down Expand Up @@ -120,11 +110,7 @@ internal string AssemblyDirectory
{
switch (BuildTarget)
{
#if UNITY_2017_3_OR_NEWER
case BuildTarget.StandaloneOSX:
#else
case BuildTarget.StandaloneOSXIntel64:
#endif
{
return PathUtil.Combine(PackagePath, string.Format("{0}.app", PackageName), "Contents", "Resources", "Data", "Managed");
}
Expand Down Expand Up @@ -202,11 +188,7 @@ private static PlatformData CreatePlatformData(BuildTarget buildTarget)
return new PlatformData("Managed", "Windows", "_Data", ".exe");
case BuildTarget.StandaloneWindows64:
return new PlatformData("Managed", "Windows", "_Data", ".exe");
#if UNITY_2017_3_OR_NEWER
case BuildTarget.StandaloneOSX:
#else
case BuildTarget.StandaloneOSXIntel64:
#endif
return new PlatformData("Contents/Data/Managed", "Mac", ".app", "");
case BuildTarget.StandaloneLinux64:
return new PlatformData("Managed", "Linux", "_Data", "");
Expand All @@ -228,12 +210,19 @@ internal void BuildPlayer()

var playerOptions = new BuildPlayerOptions { target = BuildTarget, locationPathName = tempExecutablePath, options = options, scenes = scenes };
var buildErrorMessage = BuildPipeline.BuildPlayer(playerOptions);
#if UNITY_2018_1_OR_NEWER
if (buildErrorMessage.summary.result != BuildResult.Succeeded)
{
throw new ApplicationException(string.Format("Failed to build player {0} due to {1} errors", BuildConfigComment,
buildErrorMessage.summary.totalErrors));
}
#else
if (!string.IsNullOrEmpty(buildErrorMessage))
{
throw new ApplicationException(string.Format("Failed to build player {0} due to {1}", BuildConfigComment,
buildErrorMessage));
}

#endif
Debug.LogFormat("Built player {0} into {1}", BuildConfigComment, PackagePath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace Improbable.Unity.EditorTools
[InitializeOnLoad]
public class SpatialOsWindow : EditorWindow
{
private const string MinVersion = "5.6.0";
private const string MaxVersion = "2017.3.0";
private const string MinVersion = "2017.3.0";
private const string MaxVersion = "2018.1.3";

private static SharedGuiContent sharedContent;
private static string versionMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ public class EntityPrefabExporter
{
{ BuildTarget.StandaloneWindows, Platform.BuildPlatform.Windows },
{ BuildTarget.StandaloneWindows64, Platform.BuildPlatform.Windows },
#if UNITY_2017_3_OR_NEWER
{ BuildTarget.StandaloneOSX, Platform.BuildPlatform.OSX },
#else
{ BuildTarget.StandaloneOSXIntel, Platform.BuildPlatform.OSX },
{ BuildTarget.StandaloneOSXIntel64, Platform.BuildPlatform.OSX },
{ BuildTarget.StandaloneOSXUniversal, Platform.BuildPlatform.OSX },
#endif
{ BuildTarget.StandaloneLinux, Platform.BuildPlatform.Linux },
{ BuildTarget.StandaloneLinux64, Platform.BuildPlatform.Linux },
{ BuildTarget.iOS, Platform.BuildPlatform.iOS }
Expand Down

0 comments on commit fccbefb

Please sign in to comment.