write to console on run
This commit is contained in:
@@ -43,4 +43,37 @@ public static class NodeExtensions
|
||||
}).CallDeferred();
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
}
|
||||
|
||||
public static class GodotTask
|
||||
{
|
||||
public static async Task Run(Action action)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
GD.PrintErr($"Error: {ex}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static async Task Run(Func<Task> action)
|
||||
{
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await action();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
GD.PrintErr($"Error: {ex}");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user