ConsoleX - Customizable Debug Console
Note: ConsoleX now supports both JavaScript and C#!
Quick Info:
Documentation
Asset Store Link
Price: $20.00
Version: 1.1
What is it?
ConsoleX is an easy to use collection of scripts for creating an in-game debug console. The goal behind the project is to require as little effort from you as possible to implement it, and it delivers – the entire console can be initialized with one line of code, and each additional command requires only one more line of code to add a link between the console and your custom method.
What does it do?
After writing the (minimal) code to link your methods with the console, ConsoleX scans for linked methods at the start of your game and builds a list of commands which can be accessed via the provided default console GUI, or used to implement your own custom GUI.
How does it work?
Implementation is a very easy two part process. The first part involves building the console. The easiest method is to simply use the provided default console. The second part involves linking your methods to the console, which is done via attributes. Simply add the attribute at the top of your method, and you’re done.
For those who wish to create their own console, you can build your own GUI and then pass the text input from it to the console via ConsoleX.SendCommand(textInput). The linking method stays the same.
Full documentation with examples is available, and the scripts are documented for those who wish to delve deeper.
Example of the code required to create your console:
void Start()
{
// This is it
ConsoleX.Init();
}
void OnGUI()
{
// Assume you store your text input to this variable
string textInput = "";
// When you press the enter key
ConsoleX.SendCommand(textInput);
}
Example of the code required to link your methods with ConsoleX
// Call the "yourMethod" function when you input /doMyMethod into the console.
// and print "/doMyMethod - Does your method" when you type /help."
[ConsoleCommand("/doMyMethod", "yourMethod", "Does your method")]
public void yourMethod()
{
// do your stuff here.
}
Features
The primary features of ConsoleX include:
- Easy to use.
- Create your own custom commands with minimal code (one line!), and link them to your own custom methods.
- Supports additional parameters
- ConsoleX framework can be used in a console with a custom built UI.
- A default console is provided if you don’t want to build your own – just drag and drop in seconds.
- Two commands are provided in all consoles that use ConsoleX: /log (logs all console output to a text file), and /help (shows a list of all commands and their documentation).
Future Support
ConsoleX is in an early version and as such the hope is that as many people as possible will provide feedback as to requested features. For now, the following updates are planned (in no particular order):
- Parameter support for MonoBehaviors (parameters are currently supported for non-MonoBehavior scripts.
- A more advanced default console, including the ability to split the output shown between Warnings, Errors, Log Statements, or All Statements.
- A Unity Editor GUI for flagging your methods to be callable via the console without touching your code.
Screenshot of the default console:
**Default console GUI is based off of a script provided by Matthew Miner licensed freely for public use - see documentation for details.