Skip to content

Easy to setup and use command console for unity runtime.

Notifications You must be signed in to change notification settings

cemuka/command-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

command-console

Command Console

Inspired by Quantum Console from unity asset store. It looks pretty awesome.

Usage

Simply log any string

Console.Log("This is the way");
Console.Log("Also with text support for colors", "green");

Just call Initialize to setup. It will create the command view from Resources. Add your commands with Register.

private void Start()
{
    Console.Initialize();
    Console.Register("greet", Greet);
}

private void Greet(string[] args)
{
    if (args != null && args.Length >= 1)
    {
        var log = "Greetings, " + string.Join(" ", args);
        Console.Log(log, "green");
    }
    else
    {
        Console.Log("Err, missing argument!");
    }
}

Easily show and hide.

private void Update()
{
    if (Input.GetKeyDown(KeyCode.DoubleQuote))
    {
        if(Console.IsActive) 
        {
            Console.Hide();
        }
        else
        {
            Console.Show();
        }
    }
}

LICENSE

MIT Cem Ugur Karacam