AssetBundle.Unload(true) removes DLL references

I have made an asset bundle with prefabs. These prefabs reference scripts contained in a DLL and use the default Unity models. After importing the DLL in another project and loading the bundle, I instance the prefabs. Also, the DLL is only referenced by the bundle. Everything goes as expected, and at some point later, I unload the bundle completely.

When unloading happens, the primitive models remain. This is expected behavior of course, since they are not part of the asset bundle. However, I’ve noticed that the DLL scripts referenced are removed, even though they are not a part of the bundle.

My questions are:

  • Why does Unity remove the DLL
    references when the DLL is obviously
    not part of the bundle?
  • Does this mean that the library
    unloads as well?

Partial answer:

I just called this bit of code after unloading the bundle:

string message = string.Empty;
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
    message += assembly.FullName + "

";
}
Debug.Log(message);

The assembly is still in the app domain, which answers my second question, but the first question is still a mystery.