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

@@ -3,6 +3,7 @@
#include "GameCooker.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Scripting/MainThreadManagedInvokeAction.h"
#include "Engine/Scripting/ManagedCLR/MTypes.h"
#include "Engine/Scripting/ManagedCLR/MClass.h"
#include "Engine/Scripting/Scripting.h"
#include "Engine/Scripting/ScriptingType.h"
@@ -450,7 +451,7 @@ void GameCookerImpl::OnCollectAssets(HashSet<Guid>& assets)
}
MCore::AttachThread();
MonoObject* exception = nullptr;
MObject* exception = nullptr;
auto list = (MonoArray*)Internal_OnCollectAssets->Invoke(nullptr, nullptr, &exception);
if (exception)
{
@@ -486,7 +487,7 @@ bool GameCookerImpl::Build()
Steps.Add(New<PostProcessStep>());
}
MCore::Instance()->AttachThread();
MCore::AttachThread();
// Build Started
CallEvent(GameCooker::EventType::BuildStarted);

View File

@@ -11,5 +11,7 @@ class CustomEditorsUtil
{
public:
#if USE_MONO
static MonoReflectionType* GetCustomEditor(MonoReflectionType* refType);
#endif
};

View File

@@ -126,7 +126,7 @@ void OnVisualScriptingDebugFlow()
flowInfo.ScriptInstance = stack->Instance ? stack->Instance->GetOrCreateManagedInstance() : nullptr;
flowInfo.NodeId = stack->Node->ID;
flowInfo.BoxId = stack->Box->ID;
MonoObject* exception = nullptr;
MObject* exception = nullptr;
void* params[1];
params[0] = &flowInfo;
Internal_OnVisualScriptingDebugFlow->Invoke(nullptr, params, &exception);
@@ -191,7 +191,7 @@ void ManagedEditor::Init()
{
LOG(Fatal, "Failed to create editor instance.");
}
MonoObject* exception = nullptr;
MObject* exception = nullptr;
bool isHeadless = CommandLine::Options.Headless.IsTrue();
bool skipCompile = CommandLine::Options.SkipCompile.IsTrue();
bool newProject = CommandLine::Options.NewProject.IsTrue();
@@ -259,7 +259,7 @@ void ManagedEditor::Update()
}
// Call update
MonoObject* exception = nullptr;
MObject* exception = nullptr;
UpdateMethod->Invoke(instance, nullptr, &exception);
if (exception)
{
@@ -291,7 +291,7 @@ void ManagedEditor::Exit()
{
LOG(Fatal, "Invalid Editor assembly!");
}
MonoObject* exception = nullptr;
MObject* exception = nullptr;
exitMethod->Invoke(instance, nullptr, &exception);
if (exception)
{

View File

@@ -456,7 +456,7 @@ void ScriptsBuilderImpl::CallCompileEvent(EventData& data)
LOG(Fatal, "Invalid Editor assembly!");
}
}
/*MonoObject* exception = nullptr;
/*MObject* exception = nullptr;
void* args[1];
args[0] = &data.Type;
Internal_OnEvent->Invoke(nullptr, args, &exception);