|
EasyConsole
|
The EasyConsole console. More...
Classes | |
| struct | DirectCommand |
Public Member Functions | |
| delegate bool | ParserCallback (string str, out object obj) |
| void | RegisterCommand (string command, object instance, string methodName) |
| Register a new command with the console. | |
| void | RegisterCommand (string command, object instance, MethodInfo method) |
| Register a new command with the console. | |
| void | RemoveCommand (string command) |
| Removes a command. After this the command can't be called from the console anymore. | |
| void | RegisterParser (Type type, ParserCallback func) |
| Registers a custom parser used to parse strings to their correct type. | |
| void | Print (string line) |
| Prints a simple line in the console. | |
| void | Eval (string line) |
| Executes the given command. | |
| string[] | GetGameobjectsAtPath (string path) |
| Returns a list of children gameobjects as defined by the path. The last entry in the path is used as a filter. | |
| string[] | GetComponentsOfGameobject (string path) |
| Returns the components of the given object. | |
| string[] | GetMethodsOfComponent (string path) |
| Returns the methods available on the given component. | |
Static Public Member Functions | |
| static void | parseCommand (string line, out string command, out string[] gameobjectPath, out string componentName, out string methodName, out string[] parameters) |
| Parses a command string into its separate components. | |
| static void | parseGameObjectString (string line, out string[] gameobjectPath, out string componentName, out string methodName) |
| Parses a gameobject hierarchy string. objects are separatef with a "/". component and methods are separated with a ".". | |
Public Attributes | |
| int | maxLineWidth = 80 |
Properties | |
| static Console | Instance [get] |
| Singleton instance. Null if object is disabled or not in the scene. | |
| CircularBuffer< string > | Lines [get] |
| The history buffer. | |
| CircularBuffer< string > | Commands [get] |
| The command history buffer. | |
The EasyConsole console.
| void Console.Eval | ( | string | line | ) |
Executes the given command.
| line | The command string |
| string [] Console.GetComponentsOfGameobject | ( | string | path | ) |
Returns the components of the given object.
| path | The object path |
| string [] Console.GetGameobjectsAtPath | ( | string | path | ) |
Returns a list of children gameobjects as defined by the path. The last entry in the path is used as a filter.
| path | The gameobject path |
| string [] Console.GetMethodsOfComponent | ( | string | path | ) |
Returns the methods available on the given component.
| path | The path to the component in the form "object/object.component" |
| static void Console.parseCommand | ( | string | line, |
| out string | command, | ||
| out string[] | gameobjectPath, | ||
| out string | componentName, | ||
| out string | methodName, | ||
| out string[] | parameters | ||
| ) | [static] |
Parses a command string into its separate components.
| line | The command string |
| command | The command if it is a command. null if it is a method on an object |
| gameobjectPath | The path of the object in the command string. Will be null if it is a command. |
| componentName | The name of the component. Will be null if command or when not present |
| methodName | The method or fieldname. Will be null if command or when not present |
| parameters | The parameters given to the command/method. will return null when command string is empty, otherwise the parameters or an empty array |
| static void Console.parseGameObjectString | ( | string | line, |
| out string[] | gameobjectPath, | ||
| out string | componentName, | ||
| out string | methodName | ||
| ) | [static] |
Parses a gameobject hierarchy string. objects are separatef with a "/". component and methods are separated with a ".".
| line | The gameobject hierarchy string |
| gameobjectPath | The gameobject names |
| componentName | The component name |
| methodName | The method name |
| void Console.Print | ( | string | line | ) |
Prints a simple line in the console.
| line | A string to print in the console |
| void Console.RegisterCommand | ( | string | command, |
| object | instance, | ||
| string | methodName | ||
| ) |
Register a new command with the console.
| command | A string identifying the command. Commands can be called from the console using this name |
| instance | An object that the command is performed on |
| methodName | A string containing the name of the method |
| void Console.RegisterCommand | ( | string | command, |
| object | instance, | ||
| MethodInfo | method | ||
| ) |
Register a new command with the console.
| command | A string identifying the command. Commands can be called from the console using this name |
| instance | An object that the command is performed on |
| method | The methodInfo |
| void Console.RegisterParser | ( | Type | type, |
| ParserCallback | func | ||
| ) |
Registers a custom parser used to parse strings to their correct type.
| type | The resulting type |
| func | The parse method |
| void Console.RemoveCommand | ( | string | command | ) |
Removes a command. After this the command can't be called from the console anymore.
| command | The command to remove |
CircularBuffer<string> Console.Commands [get] |
The command history buffer.
Console Console.Instance [static, get] |
Singleton instance. Null if object is disabled or not in the scene.
CircularBuffer<string> Console.Lines [get] |
The history buffer.