Commander is a developer console. Fast, simple and has many features.
Version: | Instruction |
---|---|
Release version: | follow releases |
Experimental version: | 1. Open Package Manager in Unity2. Select Add package from Git URL 3. Paste Git URL: https://github.com/ainurdada/com.dada.commander.git |
For using Commanders API you should use namespace Dada.Commander
- Add
ConsoleCommand
attribute for your method.
Example:[ConsoleCommand] // <-- just add this attribute static void SetMaxFps(int fps) { Application.targetFrameRate = fps; }
- Thats all! Now you can write method's name in the console ui. But there are still a lot of additional settings that will help when working with the commander. About them further.
Console UI is located on path Commander\UI\Prefab
Use namespace Dada.Commander.UI
to manage console UI
Methods | Descripton |
---|---|
ChangeOpenCloseState |
Open or close console window |
FillAuto |
Autofill inputfield by similar command |
SelectNextHelperItem |
Select next command in PopUp command window |
SelectPreviousHelperItem |
Select previous command in PopUp command window |
SelectNextLastCommand |
Select an older command |
SelectPreviousLastCommand |
Select a newer command |
Property | Type | Description |
---|---|---|
WindowIsShowed |
bool |
True if the console is shown and false if not |
PopUpHelperIsShowed |
bool |
True if the PopUp command window is shown and false if not |
Event | Description |
---|---|
OnShowed |
Called when the console is showed |
OnHided |
Called when the console is hided |
Field | Default value | Description |
---|---|---|
commandName |
method name | Name for Commander If you dont set commandName it takes name of method |
description |
Description for Commander This description can be shown in Commander's log |
|
logResult |
Log result that will be written to the Commander's log after successful method apllying | |
commandFlag |
CommandFlags.noFlags |
Flag that describe type of method |
Method | Parameters | Descripton |
---|---|---|
ApplyCommand |
string command,out List<string> log |
Invoke method or field by his command name and get a log result. command - command name and parameters of class member log - log result of applying command |
GetSimilarCommand |
string command |
Get the name of the commands that is most similar to the entered command |
GetSimilarCommands |
string command |
Get names of the commands that are similar to the entered command |
GetAllConsoleTypes |
Get all class names that have methods with ConsoleCommand attribute |
|
GetCommands |
bool showDescription |
Get all commands with or without their descriptions |
GetCommands |
bool showDescription CommandFlags commandFlags |
Get commands with or without their descriptions that has commandFlags |
Log |
string message |
Send message to LogEvent event |
LogWarning |
string message |
Send message to LogEvent event |
LogError |
string message |
Send message to LogEvent event |
Event | Callback type | Description |
---|---|---|
LogEvent |
string |
Called when Log method invokes and give a log message in callback |
Property | Type | Description |
---|---|---|
PreviousCommands |
List<string> |
List of previous commands, that have been sent to Commander |
You can create your own custom flag set in com.dada.commander\Runtime\CommandFlags.cs
file, but you always should have all
flag that contains all bytes of another flags.