Long Story Short
Knowing that Ly has a customized reflection, a way to serialize data from components from C++, I’m wondering if it’s possible transfer data from an old version of the component to a new version, taking into consideration that the component might have changes in the variables, for instance a variable was deleted or added.
What happens if another objects is reading constantly (or not) public values of another components? Is there a standard way in Ly components to reference public values? or the official approach it’s always to “pull that data in every frame”?
After C++ Hot Reload extracts the new modified class and build the new version and call the constructor, the library has its own automatic serialization to save/load private and public variables of the class, so when the pointers of the old version and new version are swap the new pointer has the same data and status as before.
- Is not a real example, just to illustrate.
- A character jumps and it’s on the air in the middle of the jump animation with enum state JUMPING in a state machine.
- Hot Reload happens.
- A character continue at the same state as even private variables are restored automatically, just now have a nice FIRE particles.
It’s not the end of the world if the object it’s reset, but that allows you to have no need to restart the whole scene as other objects depends on the data of that character, and many etc.
Thanks for your answer and support.
PS: I’m trying to achieve an official and free community integration for all the Ly fans