Inspired by Quantum Console from unity asset store. It looks pretty awesome.
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();
}
}
}
MIT Cem Ugur Karacam