When a user loads a savegame, I want to detect which version of my submodule was active when that savegame was made. This way I can conditionally run some update/maintenance code.
There is a GetModuleVersion method in the class MetaDataExtensions, but it needs a MetaData object as a parameter and I don't know how to get it. I've seen many classes that use the following method + attribute to get the MetaData object, but if I add it to my submodule or behaviour class it doesn't seem to run:
Does anyone else have a clue? I could patch an existing class to get it but that's ugly.
There is a GetModuleVersion method in the class MetaDataExtensions, but it needs a MetaData object as a parameter and I don't know how to get it. I've seen many classes that use the following method + attribute to get the MetaData object, but if I add it to my submodule or behaviour class it doesn't seem to run:
C#:
[LoadInitializationCallback]
private void OnLoad(MetaData metaData)
Does anyone else have a clue? I could patch an existing class to get it but that's ugly.