Merge pull request #65046 from neikeq/dotnet-fix-exported-game-uninitialized-callbacks
C#: Fix exported game crash because of uninitialized callbacks
This commit is contained in:
commit
a5218989a2
@ -27,7 +27,8 @@ namespace GodotPlugins.Game
|
|||||||
internal static partial class Main
|
internal static partial class Main
|
||||||
{
|
{
|
||||||
[UnmanagedCallersOnly(EntryPoint = ""godotsharp_game_main_init"")]
|
[UnmanagedCallersOnly(EntryPoint = ""godotsharp_game_main_init"")]
|
||||||
private static godot_bool InitializeFromGameProject(IntPtr godotDllHandle, IntPtr outManagedCallbacks)
|
private static godot_bool InitializeFromGameProject(IntPtr godotDllHandle, IntPtr outManagedCallbacks,
|
||||||
|
IntPtr unmanagedCallbacks, int unmanagedCallbacksSize)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -37,6 +38,8 @@ namespace GodotPlugins.Game
|
|||||||
|
|
||||||
NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver);
|
NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver);
|
||||||
|
|
||||||
|
NativeFuncs.Initialize(unmanagedCallbacks, unmanagedCallbacksSize);
|
||||||
|
|
||||||
ManagedCallbacks.Create(outManagedCallbacks);
|
ManagedCallbacks.Create(outManagedCallbacks);
|
||||||
|
|
||||||
ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly);
|
ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly);
|
||||||
|
Loading…
Reference in New Issue
Block a user