![]() |
Cesium for Unity 1.21.0
|
Cesium for Unity makes use of native code - not just C# code - which means that it must be compiled for each platform on which it runs. The Cesium for Unity release packages include pre-built binaries for a number of platforms.
The following platforms are currently supported:
Cesium for Unity supports Windows as both a Unity Editor and Player platform. See the Unity Windows documentation for general information about develping Unity applications for the Windows platform.
Cesium for Unity requires an x86-64 processor on Windows; ARM64 is not currently supported. Most versions of Windows that can run Unity should be able to run Cesium for Unity as well.
Cesium for Unity supports macOS as both a Unity Editor and Player platform. See the Unity macOS documentation for general information about develping Unity applications for the macOS platform.
Cesium for Unity runs natively on both Intel x86-64 and Applie Silicon (M1, M2, M3, M4, M5, etc.) processors, and on macOS 10.15+.
Cesium for Unity supports Android and Meta Quest as Unity Player platforms. See the Unity Android documentation for general information about develping Unity applications for the Android platform.
Cesium for Unity supports both Intel x86-64 and ARM64 processors. Most Android devices use ARM64, but the x86-64 support is important to support the Magic Leap 2 device. 32-bit Android devices with ARMv7 processors are not supported.
The Android Player Settings must be configured as follows:
| Setting | Value |
|---|---|
| Scripting Backend | IL2CPP |
| Target Architectures | ARM64 or x86-64, not ARMv7 |
| Internet Access | Require |
Cesium for Unity supports iOS as a Unity Player platform. See the Unity iOS documentation for general information about developing Unity applications for the iOS platform.
Cesium for Unity supports Universal Windows Platform (UWP) as a Unity Player platform. This is most useful when targetting HoloLens devices, but it can also be used to build desktop applications.
Both the "Intel 64-bit" and "ARM 64-bit" architectures are supported. 32-bit platforms are not supported.
Be sure that the InternetClient capability is enabled in the Player Settings.
Cesium for Unity supports the Web as a Unity Player platform. Both WebGL and WebGPU are supported. Unity 6 or later is required. See the Unity Web documentation for general information about developing Unity applications for the Web.
You must turn on "Enable Native C/C++ Multithreading" in the Player Settings. If you don't, you will see errors like this at build time:
wasm-ld: error: Library/PackageCache/com.cesium.unity@57778A6EB39E/Plugins/WebGL/libCesiumForUnityNative-Runtime.a(CesiumCreditSystem.cpp.o): undefined symbol: __wasm_lpad_context wasm-ld: error: Library/PackageCache/com.cesium.unity@57778A6EB39E/Plugins/WebGL/libCesiumForUnityNative-Runtime.a(CesiumCreditSystem.cpp.o): undefined symbol: _Unwind_CallPersonality
When using the "Build and Run" button in the Unity Editor, Unity starts a simple web server to host your web application, and this works great for testing. To host the built application on your own web server, however, you need to ensure that the proper HTTP response headers are set. As explained in the Unity documentation, these required response headers are:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corpCross-Origin-Resource-Policy: cross-originFailure to set these headers will result in a popup when the application loads saying, "Your web browser does not support multithreading."
Your custom web server must also be configured to serve files with the extension .br with the following response header:
Content-Encoding: brIf this header is missing, the web page will display an error explaining that this needs to be done. If this is difficult to arrange, you can avoid the need by enabling the Decompression Fallback option in the Player Settings. However, this will increase startup time.
Cesium for Unity's native code is quite portable, so building it for other platforms should be possible. However, it is not possible to target other platforms when using the released Cesium for Unity packages. Instead, you will need to build it from the source code on GitHub.
The basic steps are as follows:
SupportedPlatforms near the top of Build~/Package.cs. This is the name that is used to refer to the platform on the command-line.Run method in that same file to launch Unity and build it for the new platform. Copy an existing platform and modify it as appropriate.ConfigureReinterop.cs files, adding a new #if-protected CppOutputPath for your platform. Here the UNITY_* symbols must match the names Unity uses for the platform.If all that works flawlessly (good luck!) you will be able to build a player for your new platform from the Editor UI, and it will build the native code to go with it. You can also build from the command-line by running something like:
Where MyNewPlatform is the name used in step (2).