I'm making a custom C++ game engine, and I'd like to do something similar to what Unity does by auto-serializing public members of MonoBehavior classes, which subsequently allows for the member to be drawn in the editor (ImGui, in my case).
My question is: how does Unity actually do this auto-detection? It seems like this feature is closely tied to reflection, but at least with the C++ reflection libraries that I've looked at, it seems that you have to manually "register" your members for iteration later on.
How does Unity do this without the user of the class having to do any manual registration?
I've researched C++ reflection libraries, specifically RTTR and Meta. Both of them require manual registration of class data members.
Aucun commentaire:
Enregistrer un commentaire