CesiumGS / cesium-unity-samples

Sample project for Cesium for Unity
Apache License 2.0
233 stars 42 forks source link

Null Reference Exception when Loading Tileset from Disk #48

Closed dagrooms52 closed 1 year ago

dagrooms52 commented 1 year ago

I have a tileset that successfully loads in versions 0.2.0 and 0.1.2 when the path on disk is entered as the URL for a Blank 3DTiles component following these instructions.

In release version 0.3.0 of this project, the following exception is printed in the Unity console when attempting to load this tileset. This prevents the project from loading the tileset models, and prevents navigating to the tileset location.

NullReferenceException: Object reference not set to an instance of an object
Reinterop.ReinteropInitializer.System_Collections_Generic_Dictionary5Hx6c0Eu2sl__zevLSSpjKA_CallGetEnumerator_1B2M2Y8AsgTpgAmY7PhCfg (System.IntPtr thiz) (at Library/PackageCache/com.cesium.unity@0.3.0/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:32197)
(wrapper native-to-managed) Reinterop.ReinteropInitializer.System_Collections_Generic_Dictionary5Hx6c0Eu2sl__zevLSSpjKA_CallGetEnumerator_1B2M2Y8AsgTpgAmY7PhCfg(intptr)
Reinterop.ReinteropInitializer+ActionA2lFbwI_1jdffaYu1u_OZgNativeFunction.Invoke (UnityEngine.AsyncOperation obj) (at Library/PackageCache/com.cesium.unity@0.3.0/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:31811)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <88d854ea2c91426ebc464f01cd71aa85>:0)
dagrooms52 commented 1 year ago

Looks like others have hit this as well. Feel free to close as duplicate. https://github.com/CesiumGS/cesium-unity/issues/234 https://community.cesium.com/t/i-got-a-unity-error-after-i-try-to-add-my-own-3dtileset-from-a-local-directory/22661

kring commented 1 year ago

Thanks @dagrooms52. As you suggested, I'll close this as a duplicate. We're about to ship v0.3.1 to fix this.