Add support for binary modules with native-code only

This commit is contained in:
Wojtek Figat
2021-02-25 13:01:15 +01:00
parent 3da6f9186c
commit b193a7abc4
21 changed files with 123 additions and 27 deletions

View File

@@ -900,7 +900,7 @@ public:
if (stack && stack->Scope)
{
const int32 count = stack->Scope->Parameters.Length() + stack->Scope->ReturnedValues.Count();
const auto mclass = GetBinaryModuleFlaxEngine()->Assembly->GetClass("FlaxEditor.Editor+VisualScriptLocal");
const auto mclass = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly->GetClass("FlaxEditor.Editor+VisualScriptLocal");
ASSERT(mclass);
result = mono_array_new(mono_domain_get(), mclass->GetNative(), count);
VisualScriptLocalManaged local;
@@ -954,7 +954,7 @@ public:
s = s->PreviousFrame;
count++;
}
const auto mclass = GetBinaryModuleFlaxEngine()->Assembly->GetClass("FlaxEditor.Editor+VisualScriptStackFrame");
const auto mclass = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly->GetClass("FlaxEditor.Editor+VisualScriptStackFrame");
ASSERT(mclass);
result = mono_array_new(mono_domain_get(), mclass->GetNative(), count);
s = stack;

View File

@@ -175,7 +175,7 @@ ManagedEditor::ManagedEditor()
: PersistentScriptingObject(SpawnParams(ObjectID, ManagedEditor::TypeInitializer))
{
// Link events
auto editor = GetBinaryModuleFlaxEngine()->Assembly;
auto editor = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly;
editor->Loaded.Bind<ManagedEditor, &ManagedEditor::OnEditorAssemblyLoaded>(this);
ProbesRenderer::OnRegisterBake.Bind<OnRegisterBake>();
ProbesRenderer::OnFinishBake.Bind<OnFinishBake>();
@@ -192,7 +192,7 @@ ManagedEditor::ManagedEditor()
ManagedEditor::~ManagedEditor()
{
// Unlink events
auto editor = GetBinaryModuleFlaxEngine()->Assembly;
auto editor = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly;
editor->Loaded.Unbind<ManagedEditor, &ManagedEditor::OnEditorAssemblyLoaded>(this);
ProbesRenderer::OnRegisterBake.Unbind<OnRegisterBake>();
ProbesRenderer::OnFinishBake.Unbind<OnFinishBake>();