I’m having problems trying to compile the project targeting the tvOS platform.
I think it’s not an issue with my project integrating the package, because opening the the Unity samples for v1.19.0 with Unity 6 targeting tvOS has the same compilation errors:
Library/PackageCache/com.cesium.unity@03780efe4504/Runtime/CesiumPointCloudRenderer.cs(101,17): error CS0103: The name 'XRSettings' does not exist in the current context
Library/PackageCache/com.cesium.unity@03780efe4504/Runtime/CesiumPointCloudRenderer.cs(101,51): error CS0103: The name 'XRSettings' does not exist in the current context
Library/PackageCache/com.cesium.unity@03780efe4504/Runtime/CesiumPointCloudRenderer.cs(102,17): error CS0103: The name 'XRSettings' does not exist in the current context
Library/PackageCache/com.cesium.unity@03780efe4504/Runtime/CesiumPointCloudRenderer.cs(102,51): error CS0103: The name 'XRSettings' does not exist in the current context
I’ve tried removing all XR and VR packages (because we don’t need them) and the problem persists.
I’ve also created a bug in the GitHub page with the same issue.
I just found out that if I add in PlayerSetting only for tvOS in the Scripting Define Symbols the define ENABLE_XR the compilation errors disappear, but a new one appear:
Library/PackageCache/com.unity.test-framework@1f954279c37e/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageBuilder.cs(49,47): error CS0117: ‘XRDevice’ does not contain a definition for ‘model’
Ok, one way to fix this is to modify the package to fix this class for tvOS. Basically in the class that is throwing the error CesiumPointCloudRenderer, add a #if_def in the part that is causing the error:
tvOS is not a supported platform, and as far as I know you’re the first person to try it.
I think that even if you get past these XR issues, you’ll also need to build the native code for the tvOS platform. This is usually the much more challenging part of supporting a new platform. To start, you’ll need to follow the Developer Setup instructions. Changes to the plugin will certainly be required. But if you get it working, we’re happy to accept a pull request for it, and then your changes will be included in the next release!
Can you please walk us through the steps that lead to the problem you’re seeing? If you believe you have a fix, please open a pull request with it and we’ll take a look!
The XR related symbols can’t be accessed unless the Unity package “com.unity.xr.management” is installed in the Unity project. I see that the package is there by default for some template projects (I verified the URP template). But our Unity project does not have that package installed for some reason. It might have been explicitly uninstalled because it is not really needed for us.
When that package is missing, we get the following error for CesiumForUnity package compilation:
Library/PackageCache/com.cesium.unity@03780efe4504/Runtime/CesiumPointCloudRenderer.cs(101,17): error CS0103: The name ‘XRSettings’ does not exist in the current context
It can be fixed by adding ENABLE_XR_MODULE checks around the according code:
However even after your fix I am not able to compile our project for tvOS platform with error message: The type or namespace name ‘CesiumForUnity’ could not be found. Any idea what can be wrong? Others platforms OK, same for Editor.
It is maybe the lack of support of tvOS, @Kevin_Ring is not by any chance tvOS support on your roadmap? Thx
tvOS is not a supported platform, so the native code binaries for that platform are missing. You’ll need to make modifications to the plugin to support that platform, and build it yourself.