Merge branch 'delegate_mutex' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-delegate_mutex

This commit is contained in:
Wojtek Figat
2023-09-13 10:57:34 +02:00
2 changed files with 120 additions and 164 deletions

View File

@@ -128,11 +128,6 @@ bool ScriptingService::Init()
{
const auto startTime = DateTime::NowUTC();
// Link for assemblies events
auto engineAssembly = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly;
engineAssembly->Loaded.Bind(onEngineLoaded);
engineAssembly->Unloading.Bind(onEngineUnloading);
// Initialize managed runtime
if (MCore::LoadEngine())
{
@@ -483,6 +478,8 @@ bool Scripting::Load()
return true;
}
onEngineLoaded(flaxEngineModule->Assembly);
// Insert type aliases for vector types that don't exist in C++ but are just typedef (properly redirect them to actual types)
// TODO: add support for automatic typedef aliases setup for scripting module to properly lookup type from the alias typename
#if USE_LARGE_WORLDS
@@ -585,6 +582,9 @@ void Scripting::Release()
asset->DeleteObjectNow();
}
auto* flaxEngineModule = (NativeBinaryModule*)GetBinaryModuleFlaxEngine();
onEngineUnloading(flaxEngineModule->Assembly);
// Unload assemblies (from back to front)
{
LOG(Info, "Unloading binary modules");