50b603c7dc
We're targeting .NET 5 for now to make development easier while .NET 6 is not yet released. TEMPORARY REGRESSIONS --------------------- Assembly unloading is not implemented yet. As such, many Godot resources are leaked at exit. This will be re-implemented later together with assembly hot-reloading.
27 lines
681 B
C#
27 lines
681 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Godot.NativeInterop;
|
|
|
|
namespace Godot
|
|
{
|
|
public static class Dispatcher
|
|
{
|
|
internal static GodotTaskScheduler DefaultGodotTaskScheduler;
|
|
|
|
[UnmanagedCallersOnly]
|
|
internal static void InitializeDefaultGodotTaskScheduler()
|
|
{
|
|
try
|
|
{
|
|
DefaultGodotTaskScheduler = new GodotTaskScheduler();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
ExceptionUtils.DebugUnhandledException(e);
|
|
}
|
|
}
|
|
|
|
public static GodotSynchronizationContext SynchronizationContext => DefaultGodotTaskScheduler.Context;
|
|
}
|
|
}
|