You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using C# in your Godot project, you can implement ISerializationListener to execute code in OnBeforeSerialize and OnAfterDeserialize. These functions are called when building the C# solution, and perhaps also in other circumstances?
This feature can be helpful if you have to acount for serialization in your [Tool] scripts, but is completely undocumented. I only found out about its existence via this informative issue: godotengine/godot-proposals#9001
Frankly, it would be helpful if all the information in that issue was added to the documentation. The Godot API for C# section seems like a logical place.
I can attempt to write the documentation, but I'm not particularly knowledgable about the behaviour of ISerializationListener, and even less on the entire process of rebuilding the C# solution.
URL to the documentation page (if already existing):
N/A
The text was updated successfully, but these errors were encountered:
The ISerializationListener interface is intentionally undocumented because we don't want to encourage its usage. It likely should have been internal from the beginning.
In the engine code we use it to maintain state across assembly reloads. The process of reloading the .NET assemblies is indeed quite complicated and ideally not something users should need to worry about.
We'll likely change the reloading process in the future and we don't want to limit ourselves to the current ISerializationListener design, we may want to change it.
That there are good reasons to discourage the use of the interface, I can understand. Still, it is strange to me to choose to keep it undocumented. This creates a situation where the intent of the interface is unclear, and doesn't warn a potential user that discovers its existence against using it. Also because it pops up in a number of Issues, see for example also this one: godotengine/godot#90837. And after finding it in these issues, I used it to create a work-around for this issue I encountered: godotengine/godot#102455.
Would it not be clearer to add it to the documentation with the strong warning against relying on it?
Your Godot version:
4.3
Issue description:
If you are using C# in your Godot project, you can implement ISerializationListener to execute code in OnBeforeSerialize and OnAfterDeserialize. These functions are called when building the C# solution, and perhaps also in other circumstances?
This feature can be helpful if you have to acount for serialization in your [Tool] scripts, but is completely undocumented. I only found out about its existence via this informative issue: godotengine/godot-proposals#9001
Frankly, it would be helpful if all the information in that issue was added to the documentation. The Godot API for C# section seems like a logical place.
I can attempt to write the documentation, but I'm not particularly knowledgable about the behaviour of ISerializationListener, and even less on the entire process of rebuilding the C# solution.
URL to the documentation page (if already existing):
N/A
The text was updated successfully, but these errors were encountered: