Skip to content

Commit

Permalink
Merge pull request #195 from CesiumGS/catch-type-initializer-exception
Browse files Browse the repository at this point in the history
Catch TypeInitializerException to avoid log spam during builds.
  • Loading branch information
kring authored Feb 1, 2023
2 parents c9ce261 + 3599030 commit 25294b3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
reporter: dotnet-nunit
MacOS:
needs: [QuickChecks]
runs-on: macos-latest
runs-on: macos-11
# Only allow a single macOS build at a time, for Unity licensing reasons
concurrency: mac
steps:
Expand Down
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

##### Additions :tada:

- Added support for building to iOS.
- Added `CesiumCameraController`, a globe-aware controller that adapts its speed and clipping planes based on its height from the globe.
- Added `CesiumFlyToController`, a controller that can smoothly fly to locations across the globe.
- Added an option to add a `DynamicCamera` from the Cesium panel to the scene. The `DynamicCamera` contains `CesiumCameraController` and `CesiumFlyToController` components and offers easy navigation of the globe.
- Added support for building to iOS.
- Added support for building to Android x86-64 devices like the Magic Leap 2.

##### Fixes :wrench:

- Fixed a bug where `CesiumGeoreference`, `CesiumGlobeAnchor`, and `CesiumSubScene` would not properly update when their values were changed by undos or pasted values.
- `CesiumRuntimeSettings` is now stored in `Assets/CesiumSettings/Resources` instead of `Assets/Settings/Resources`.
- Added an explicit `Physics.SyncTransforms` when `CesiumOriginShift` activates or deactivates sub-scenes, avoiding a brief period of potentially very incorrect collisions.

In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.21.1 to v0.21.3. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.

### v0.1.2

Expand Down
20 changes: 19 additions & 1 deletion Editor/BuildCesiumForUnity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,26 @@ private static void BuildPlayer(BuildTargetGroup targetGroup, BuildTarget target
target = target,
scenes = new[] { "Assets/Scenes/Empty.unity" }
});

if (report.summary.totalErrors > 0)
throw new Exception("Build failed");
{
StringBuilder errorReport = new StringBuilder();
errorReport.AppendLine("BuildPlayer failed:");
foreach (BuildStep step in report.steps)
{
var errorMessages = step.messages.Where(message => message.type == LogType.Error || message.type == LogType.Exception);
if (!errorMessages.Any())
continue;

errorReport.AppendLine(" In step " + step.name + ":");

foreach (BuildStepMessage message in errorMessages)
{
errorReport.AppendLine(" - " + message.content);
}
}
throw new Exception(errorReport.ToString());
}

// We don't actually need the built project; delete it.
if (Directory.Exists(outputPath))
Expand Down
5 changes: 4 additions & 1 deletion Editor/CesiumEditorUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ static void UpdateIonSession()
{
CesiumIonSession.Ion().Tick();
}
// Don't let a missing / out-of-sync native DLL crash everything.
catch (DllNotFoundException)
{
// Don't let a missing / out-of-sync native DLL crash everything.
}
catch (TypeInitializationException)
{
}
}

Expand Down
2 changes: 1 addition & 1 deletion Editor/CompileCesiumForUnityNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private static LibraryToBuild[] GetLibrariesToBuildForPlatform(BuildSummary summ
{
if (finalLibrariesOnly)
{
result.Add(GetLibraryToBuild(summary, "x86_64"));
result.Add(GetLibraryToBuild(summary));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion native~/extern/cesium-native
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.cesium.unity",
"version": "0.1.2",
"version": "0.2.0",
"displayName": "Cesium for Unity",
"description": "Cesium for Unity brings the 3D geospatial ecosystem to Unity. By combining a high-accuracy full-scale WGS84 globe, open APIs and open standards for spatial indexing such as 3D Tiles, and cloud-based real-world content from [Cesium ion](https://cesium.com/cesium-ion) with Unity, this plugin enables 3D geospatial workflows and applications in Unity.",
"license": "Apache-2.0",
Expand Down

0 comments on commit 25294b3

Please sign in to comment.