How can I add startup compiled components and systems to the type manager and the world? I used UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP but it there’s no official way of doing this and I get allocation errors in TypeManager.Initialize
Allocation errors like what?
I’m loading up DLLs that contain ECS systems, at runtime, so not compiling like you are, but I’m able to load DLLs, and Scenes that contain ConvertToEntity scripts,and it works.
If your errors are in editor only and not playmode in a built application due to TypeManager.Initialize() being called by
TypeDependencyCache and AttachToEntityClonerInjection, you can add your new types manually with
TypeManager.AddNewComponentTypes(), but this is editor only. But TypeDependencyCache is I think editor only as well so I hope it wouldn’t be a problem in a build
All the errors with collections not disposing are after hitting play. They come from TypeManager. I am initializing everything like this:
CompileAndAddDLLs();
TypeManager.Initialize();
DefaultWorldInitialization.Initialize("Default world", false);
Sorry, I spoke poorly when I said playmode, I should have said in a built application.
Everything I ran into with the TypeManager.Initialize() and types loaded at runtime took the form of “All ComponentType must be known at compile time”, not collections not getting disposed