Add support for compiling and running engine without C# scripting

(configurable via `EngineConfiguration.UseCSharp` in Flax.Build)
This commit is contained in:
Wojtek Figat
2021-10-23 16:41:57 +02:00
parent 0b3d6b03ac
commit 8938f13a0b
86 changed files with 1244 additions and 688 deletions

View File

@@ -14,7 +14,11 @@
#endif
#include "Engine/Core/Types/Pair.h"
#include "Engine/Threading/Threading.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-gc.h>
#endif
#if USE_MONO
namespace ProfilerInternal
{
@@ -99,9 +103,12 @@ namespace ProfilerInternal
}
}
#endif
class ScriptingInternal
{
public:
#if USE_MONO
static bool HasGameModulesLoaded()
{
return Scripting::HasGameModulesLoaded();
@@ -117,9 +124,11 @@ public:
ASSERT(IsInMainThread());
ObjectsRemovalService::Flush();
}
#endif
static void InitRuntime()
{
#if USE_MONO
// Scripting API
ADD_INTERNAL_CALL("FlaxEngine.Scripting::HasGameModulesLoaded", &HasGameModulesLoaded);
ADD_INTERNAL_CALL("FlaxEngine.Scripting::IsTypeFromGameScripts", &IsTypeFromGameScripts);
@@ -130,6 +139,7 @@ public:
ADD_INTERNAL_CALL("FlaxEngine.Profiler::EndEvent", &ProfilerInternal::EndEvent);
ADD_INTERNAL_CALL("FlaxEngine.Profiler::BeginEventGPU", &ProfilerInternal::BeginEventGPU);
ADD_INTERNAL_CALL("FlaxEngine.Profiler::EndEventGPU", &ProfilerInternal::EndEventGPU);
#endif
}
};