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

Commit ab6274c

Browse files
authored
Merge pull request #7 from spatialos/2.0.0
Upgrade to use Unity SDK v2.0.0
2 parents ec0821a + b4fb74c commit ab6274c

10 files changed

+18
-56
lines changed

workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/Configuration/SpatialOSBuildConfigurationEditor.cs

-4
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,7 @@ private static void SwapInList<T>(IList<T> list, int indexA, int indexB)
409409

410410
private static IDisposable IndentLevelScope(int increment)
411411
{
412-
#if UNITY_2017_3_OR_NEWER
413412
return new EditorGUI.IndentLevelScope(increment);
414-
#else
415-
return new FallbackIndentLevelScope(increment);
416-
#endif
417413
}
418414
}
419415
}

workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/Configuration/WorkerBuildData.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ namespace Improbable.Unity.MinimalBuildSystem.Configuration
99
{
1010
public class WorkerBuildData
1111
{
12-
internal const BuildTarget OSXBuildTarget =
13-
#if UNITY_2017_3_OR_NEWER
14-
BuildTarget.StandaloneOSX;
15-
#else
16-
BuildTarget.StandaloneOSXIntel64;
17-
#endif
12+
internal const BuildTarget OSXBuildTarget = BuildTarget.StandaloneOSX;
1813

1914
private readonly WorkerPlatform workerPlatform;
2015
private readonly BuildTarget buildTarget;

workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll.meta

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml.meta

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll.meta

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml.meta

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/Build/DefaultPlayerBuildConfiguration.cs

-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ internal static PlayerBuildConfiguation Generate()
3232
Targets = new List<string>
3333
{
3434
BuildTarget.StandaloneWindows.ToString(),
35-
#if UNITY_2017_3_OR_NEWER
3635
BuildTarget.StandaloneOSX.ToString()
37-
#else
38-
BuildTarget.StandaloneOSXIntel64.ToString()
39-
#endif
4036
}
4137
}
4238
},

workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/Build/UnityPlayerBuilder.cs

+11-22
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
using Improbable.Unity.EditorTools.Util;
99
using Improbable.Unity.Util;
1010
using UnityEditor;
11+
#if UNITY_2018_1_OR_NEWER
12+
using UnityEditor.Build.Reporting;
13+
#endif
1114
using UnityEngine;
1215

1316
namespace Improbable.Unity.EditorTools.Build
@@ -51,15 +54,6 @@ private static BuildTarget ToRuntimePlatform(string platform)
5154
if (platform.ToLower() != "current")
5255
{
5356
var value = (BuildTarget) Enum.Parse(typeof(BuildTarget), platform);
54-
#if UNITY_2017_3_OR_NEWER
55-
#pragma warning disable 618
56-
if (value == BuildTarget.StandaloneOSXIntel64)
57-
{
58-
Debug.LogWarningFormat("{0} is deprecated and will be removed. Please update {1} to use {2} instead.", BuildTarget.StandaloneOSXIntel64, UnityPlayerBuilders.PlayerConfigurationFilePath, BuildTarget.StandaloneOSX);
59-
value = BuildTarget.StandaloneOSX;
60-
}
61-
#pragma warning restore 618
62-
#endif
6357
return value;
6458
}
6559

@@ -73,11 +67,7 @@ internal static BuildTarget CurrentPlatform()
7367
case RuntimePlatform.WindowsEditor:
7468
return BuildTarget.StandaloneWindows;
7569
case RuntimePlatform.OSXEditor:
76-
#if UNITY_2017_3_OR_NEWER
7770
return BuildTarget.StandaloneOSX;
78-
#else
79-
return BuildTarget.StandaloneOSXIntel64;
80-
#endif
8171
case RuntimePlatform.LinuxEditor:
8272
return BuildTarget.StandaloneLinux64;
8373
default:
@@ -120,11 +110,7 @@ internal string AssemblyDirectory
120110
{
121111
switch (BuildTarget)
122112
{
123-
#if UNITY_2017_3_OR_NEWER
124113
case BuildTarget.StandaloneOSX:
125-
#else
126-
case BuildTarget.StandaloneOSXIntel64:
127-
#endif
128114
{
129115
return PathUtil.Combine(PackagePath, string.Format("{0}.app", PackageName), "Contents", "Resources", "Data", "Managed");
130116
}
@@ -202,11 +188,7 @@ private static PlatformData CreatePlatformData(BuildTarget buildTarget)
202188
return new PlatformData("Managed", "Windows", "_Data", ".exe");
203189
case BuildTarget.StandaloneWindows64:
204190
return new PlatformData("Managed", "Windows", "_Data", ".exe");
205-
#if UNITY_2017_3_OR_NEWER
206191
case BuildTarget.StandaloneOSX:
207-
#else
208-
case BuildTarget.StandaloneOSXIntel64:
209-
#endif
210192
return new PlatformData("Contents/Data/Managed", "Mac", ".app", "");
211193
case BuildTarget.StandaloneLinux64:
212194
return new PlatformData("Managed", "Linux", "_Data", "");
@@ -228,12 +210,19 @@ internal void BuildPlayer()
228210

229211
var playerOptions = new BuildPlayerOptions { target = BuildTarget, locationPathName = tempExecutablePath, options = options, scenes = scenes };
230212
var buildErrorMessage = BuildPipeline.BuildPlayer(playerOptions);
213+
#if UNITY_2018_1_OR_NEWER
214+
if (buildErrorMessage.summary.result != BuildResult.Succeeded)
215+
{
216+
throw new ApplicationException(string.Format("Failed to build player {0} due to {1} errors", BuildConfigComment,
217+
buildErrorMessage.summary.totalErrors));
218+
}
219+
#else
231220
if (!string.IsNullOrEmpty(buildErrorMessage))
232221
{
233222
throw new ApplicationException(string.Format("Failed to build player {0} due to {1}", BuildConfigComment,
234223
buildErrorMessage));
235224
}
236-
225+
#endif
237226
Debug.LogFormat("Built player {0} into {1}", BuildConfigComment, PackagePath);
238227
}
239228

workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/Core/SpatialOsWindow.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace Improbable.Unity.EditorTools
1616
[InitializeOnLoad]
1717
public class SpatialOsWindow : EditorWindow
1818
{
19-
private const string MinVersion = "5.6.0";
20-
private const string MaxVersion = "2017.3.0";
19+
private const string MinVersion = "2017.3.0";
20+
private const string MaxVersion = "2018.1.3";
2121

2222
private static SharedGuiContent sharedContent;
2323
private static string versionMessage;

workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/PrefabExport/EntityPrefabExporter.cs

-6
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ public class EntityPrefabExporter
2020
{
2121
{ BuildTarget.StandaloneWindows, Platform.BuildPlatform.Windows },
2222
{ BuildTarget.StandaloneWindows64, Platform.BuildPlatform.Windows },
23-
#if UNITY_2017_3_OR_NEWER
2423
{ BuildTarget.StandaloneOSX, Platform.BuildPlatform.OSX },
25-
#else
26-
{ BuildTarget.StandaloneOSXIntel, Platform.BuildPlatform.OSX },
27-
{ BuildTarget.StandaloneOSXIntel64, Platform.BuildPlatform.OSX },
28-
{ BuildTarget.StandaloneOSXUniversal, Platform.BuildPlatform.OSX },
29-
#endif
3024
{ BuildTarget.StandaloneLinux, Platform.BuildPlatform.Linux },
3125
{ BuildTarget.StandaloneLinux64, Platform.BuildPlatform.Linux },
3226
{ BuildTarget.iOS, Platform.BuildPlatform.iOS }

0 commit comments

Comments
 (0)