CesiumGS / cesium-unity

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

A new CesiumSubLevel should adopt the currently-active georeference origin #343

Closed kring closed 9 months ago

kring commented 1 year ago

Currently, when you create add a new CesiumSubLevel component to a GameObject, it is given the default georeference origin (near Denver) and then switches the currently-active georeference to that origin. This isn't great, because the user most likely wanted to create a sub-level where they were already looking, not in Denver. Fortunately, the "Create Sub-Level Here" is an effective workflow workaround, but we should still make it behave better when a sub-level is created manually.

j9liu commented 10 months ago

I believe this can / should be done using Monobehaviour's Reset function, which is already included in CesiumSubScene.

Reset is called when the user hits the Reset button in the Inspector's context menu or when adding the component the first time. This function is only called in editor mode. Reset is most commonly used to give good default values in the Inspector.

So this issue would involve: