COI Docs

New CLI Command

1. Create a new class for your command

[GlobalDependency(RegistrationMode.AsSelf)]
public class MyFirstCommand
{
}

2. Create and register your command

Create a new method to define your command.

    [ConsoleCommand(true, false, null, "hello_world")]
    GameCommandResult helloWorld()
    {
        return GameCommandResult.Success("Hello World!");
    }

Since our class is registered as a global dependency ([GlobalDependency(RegistrationMode.AsSelf)]), we can launch the game and run our command.

Open the console and type hello_world.

Edit on GitHub

On this page