EasyConsole
 All Classes Namespaces Functions Properties
Console Class Reference

The EasyConsole console. More...

List of all members.

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.

Detailed Description

The EasyConsole console.


Member Function Documentation

void Console.Eval ( string  line)

Executes the given command.

Parameters:
lineThe command string
string [] Console.GetComponentsOfGameobject ( string  path)

Returns the components of the given object.

Parameters:
pathThe object path
Returns:
An array containing the component names
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.

Parameters:
pathThe gameobject path
Returns:
An array containing the children of the given gameobject
string [] Console.GetMethodsOfComponent ( string  path)

Returns the methods available on the given component.

Parameters:
pathThe path to the component in the form "object/object.component"
Returns:
An array containing the method names
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.

Parameters:
lineThe command string
commandThe command if it is a command. null if it is a method on an object
gameobjectPathThe path of the object in the command string. Will be null if it is a command.
componentNameThe name of the component. Will be null if command or when not present
methodNameThe method or fieldname. Will be null if command or when not present
parametersThe 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 ".".

Parameters:
lineThe gameobject hierarchy string
gameobjectPathThe gameobject names
componentNameThe component name
methodNameThe method name
void Console.Print ( string  line)

Prints a simple line in the console.

Parameters:
lineA string to print in the console
void Console.RegisterCommand ( string  command,
object  instance,
string  methodName 
)

Register a new command with the console.

Parameters:
commandA string identifying the command. Commands can be called from the console using this name
instanceAn object that the command is performed on
methodNameA string containing the name of the method
void Console.RegisterCommand ( string  command,
object  instance,
MethodInfo  method 
)

Register a new command with the console.

Parameters:
commandA string identifying the command. Commands can be called from the console using this name
instanceAn object that the command is performed on
methodThe methodInfo
void Console.RegisterParser ( Type  type,
ParserCallback  func 
)

Registers a custom parser used to parse strings to their correct type.

Parameters:
typeThe resulting type
funcThe parse method
void Console.RemoveCommand ( string  command)

Removes a command. After this the command can't be called from the console anymore.

Parameters:
commandThe command to remove

Property Documentation

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.


The documentation for this class was generated from the following file: