Closed kring closed 9 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:
UpdateParentReference
to copy the CesiumGeoreference
origin coordinates into the CesiumSubScene
, after initialization.
TestCesiumSubScene
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.