Closed azrogers closed 9 months ago
Actually, the solution in my previous comment fails to account for existing sub-scenes when they're enabled in the editor. 🙃 And I don't know if the call is to make that isInitialized
variable [Serialized]
. So ignore what I wrote. I think the solution you found is fine; I'd like to add a bit of clarity to the comment but I'll put a suggestion tomorrow morning.
Just because it was driving me crazy, I looked up if there was an event for any time a component was added in the editor. I found that the ObjectFactory class exists and has a componentWasAdded
event on it, but I have no idea when this event is called in relation to the component's event cycle. It's probably not worth exploring at this point.
@j9liu Updated review based on feedback - let me know if I missed anything!
Looks great, thanks @azrogers !
Fixes #343.
When
CesiumSubScene::OnEnable
is called, it sets the coordinates of the parentCesiumGeoreference
to the coordinates it has set. This means when adding a newCesiumSubScene
component as a child of an existingCesiumGeoreference
, it would reset the coordinates of the parent to the default coordinates. This change uses theReset
event to restore the georeference's original coordinates without changing the behavior outside of the editor.