Initialize ScriptingService earlier
This commit is contained in:
@@ -269,6 +269,8 @@ bool MCore::LoadEngine()
|
||||
|
||||
// Prepare managed side
|
||||
CallStaticMethod<void>(GetStaticMethodPointer(TEXT("Init")));
|
||||
MCore::LoadScriptingAssemblyLoadContext();
|
||||
|
||||
#ifdef MCORE_MAIN_MODULE_NAME
|
||||
// MCORE_MAIN_MODULE_NAME define is injected by Scripting.Build.cs on platforms that use separate shared library for engine symbols
|
||||
::String flaxLibraryPath(Platform::GetMainDirectory() / TEXT(MACRO_TO_STR(MCORE_MAIN_MODULE_NAME)));
|
||||
@@ -311,20 +313,16 @@ void MCore::UnloadEngine()
|
||||
ShutdownHostfxr();
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
void MCore::ReloadScriptingAssemblyLoadContext()
|
||||
void MCore::LoadScriptingAssemblyLoadContext()
|
||||
{
|
||||
// Clear any cached class attributes (see https://github.com/FlaxEngine/FlaxEngine/issues/1108)
|
||||
for (auto e : CachedClassHandles)
|
||||
e.Value->_attributes.Clear();
|
||||
|
||||
static void* ReloadScriptingAssemblyLoadContextPtr = GetStaticMethodPointer(TEXT("ReloadScriptingAssemblyLoadContext"));
|
||||
CallStaticMethod<void>(ReloadScriptingAssemblyLoadContextPtr);
|
||||
static void* LoadScriptingAssemblyLoadContextPtr = GetStaticMethodPointer(TEXT("LoadScriptingAssemblyLoadContext"));
|
||||
CallStaticMethod<void>(LoadScriptingAssemblyLoadContextPtr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
MObject* MCore::Object::Box(void* value, const MClass* klass)
|
||||
{
|
||||
static void* BoxValuePtr = GetStaticMethodPointer(TEXT("BoxValue"));
|
||||
|
||||
@@ -717,7 +717,7 @@ void MCore::UnloadEngine()
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
void MCore::ReloadScriptingAssemblyLoadContext()
|
||||
void MCore::LoadScriptingAssemblyLoadContext()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void MCore::UnloadEngine()
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
void MCore::ReloadScriptingAssemblyLoadContext()
|
||||
void MCore::LoadScriptingAssemblyLoadContext()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user