Hello,
I have just finished a DLC solution for our game. It allows you to download mini games that include code. This code extends interfaces that as in the Main project but has a whole bunch of extended functionality.
Everything is working we can hit download and the bundle is downloaded from the internet and the .dll is loaded and the prefabricated game objects constructed and the classes loaded in the .dll are associated with the gameObject.
In short everything is working perfectly.
Below is the function that is part of the main application that loads the .dll into memory.
public void LoadDll(){
assembly=Assembly.Load(dllFile.bytes);
}
My question is does the assembly member of this object require a cleanup? I Destroy the GameObject instance when the .dll is finished and the user quites the mini game. I am unsure if this cleans up the memory used by the .dll in the assembly. Will it be garbage collected later and full cleanup happen?
Is there further code I need to execute to perform a solid cleanup? The game will allow many different mini games to be played downloaded and released accumulating memory could be an issue I would like to avoid.
Thanks