CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
339 stars 80 forks source link

Updates to tileset locations on ion do not appear in Unity unless Unity is reopened #492

Open corybarr opened 3 weeks ago

corybarr commented 3 weeks ago

Steps to reproduce:

  1. Select or create a tileset on ion. (A small model will work best.)
  2. Load it into a Unity scene.
  3. On ion, change the name and tileset location.
  4. Delete the tileset in Unity.
  5. Back in Unity, refresh the asset list via the blue button in the "Cesium ion Assets" panel.
  6. You should see the asset with the updated name. Select "Add to Level"
  7. The asset will be in the original location prior to the ion change.
  8. "Refresh Tileset" on the gameobjects "Cesium 3D Tileset" component doesn't update the location.
  9. Close Unity and reopen the project. The asset's position will be updated. (Note that reloading the scene without restarting Unity has no effect.)
kring commented 3 weeks ago

This is caused by the endpointCache in CesiumIonTilesetLoader.cpp: https://github.com/CesiumGS/cesium-native/blob/v0.38.0/Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp#L473

The purpose of this cache is to avoid creating extra ion sessions unnecessarily when, for example, switching between Edit and Play mode. See the original issue here: https://github.com/CesiumGS/cesium-native/issues/382

I'm not sure how we could know to bust this cache in this case, without simply hitting the endpoint service every time.