yasirkula / UnityIngameDebugConsole

A uGUI based console to see debug messages and execute commands during gameplay in Unity
MIT License
2.11k stars 221 forks source link

[Feature request] Add async commands support #28

Closed AldeRoberge closed 3 years ago

AldeRoberge commented 3 years ago

Would it be possible to add a way to call async commands?

    [ConsoleMethod("/register", "Create a new user")]
    public static async Task Register(string email, string password)
    {
        await _authenticationController.Register(email, password);
    }
yasirkula commented 3 years ago

You should be able to execute this command. The only downside is this unnecessary log:

screenshot

The workaround for this log is to create a wrapper function instead:

[ConsoleMethod("/register", "Create a new user")]
public static void RegisterUser(string email, string password)
{
    _ = Register(email, password);
}