CesiumGS / cesium-unity

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

Add `materialKey` to `CesiumRasterOverlay` #404

Closed j9liu closed 7 months ago

j9liu commented 7 months ago

Depends on #385 so merge that first.

Fixes #401.

This PR adds the materialKey property to CesiumRasterOverlay and intends to be analogous to material layer keys in Cesium for Unreal. In the tileset materials, overlay parameters now have the following syntax:

Where KEY is the string in materialKey. On the native side, raster overlays store materialKey in their name so that they can be attached / detached from the correct variables.

The UI for CesiumRasterOverlay has been updated to reflect this property. However, instead of the typical text field, it displays a popup that reflects which keys are actually present in the material.

Finally, I also took the time to add this little warning in the CesiumRasterOverlay. It appears if the raster overlay is not attached to a Cesium3DTileset. (might be nice to use this in other components too!)

kring commented 7 months ago

This looks great! One small problem I noticed: it looks like this PR is accidentally undoing a cesium-native upgrade.

j9liu commented 7 months ago

@kring Fixed, thanks for the catch!

kring commented 7 months ago

Thanks @j9liu!