Long story short
Does exist a global event that I can trigger to replace the old component pointer in Ly with the new one?
C++ Hot Reload extracts the class file to build a new version of the C++ types inside, dependent and dependencies are re-compiled if needed. In that process the most important event is “Reload_Instance” where you get a uuid that identifies that pointer (custom or auto-generated), the type name and a void* that is the newly created class using the default constructor (this can be also customized, doesn’t need to be the default constructor).
So, making an example to reduce the context, let’s imagine this scenario:
// C++ Hot Reload Events file (very simplified)
void DidReloadInstance(const char* const typeName, void*& data, const char* uuid)
for (Component* component : EcsRegistry::GetComponents())
if (component.guid == uuid)
component = static_cast<Component*>(data); // QUESTION1
newVersionOfComponent = static_cast<Component*>(data); // QUESTION1
QUESTION1: knowing will not be as simple as this how to do the same and which events, messages in the system should I call in Ly to be able to propagate the new pointer?
This is the fastest version, but also it’s ok to copy the data from the old component, register for deletion the old Component, and add to all the entities that were using the old component the new one. For instance is the default action done by UE4. I don’t like it but I understand some system are complex and with legacy code and dependencies on them
Thanks for your answer and support.
PS: I’m trying to achieve an official and free community integration for all the Ly fans