Class ConsoleCommandsHandler
A handler class for registering your custom console commands.
public static class ConsoleCommandsHandler
- Inheritance
-
ConsoleCommandsHandler
- Inherited Members
Methods
AddBiomeTeleportPosition(string, Vector3)
Adds a new teleport position to the "biome" command.
public static void AddBiomeTeleportPosition(string biomeName, Vector3 position)
Parameters
biomeName
string- The name of the teleport. Case-insensitive, no spaces allowed.
position
Vector3- The world coordinates of the teleport.
AddGotoTeleportPosition(string, Vector3)
Adds a new teleport position to the "goto" command.
public static void AddGotoTeleportPosition(string locationName, Vector3 position)
Parameters
locationName
string- The name of the teleport. Case-insensitive, no spaces allowed.
position
Vector3- The world coordinates of the teleport.
RegisterConsoleCommand(string, Type, string, Type[])
public static void RegisterConsoleCommand(string command, Type declaringType, string methodName, Type[] parameters)
Parameters
command
string- The case-insensitive command to register.
declaringType
Type- The declaring type that holds the method to call when the command is entered.
methodName
string- The name of the method to call within the declaring type when the command is entered. Method must be static.
parameters
Type[]- The parameter types the method receives, for targeting overloads.
Remarks
Target method must be static.
The command can take parameters and will respect optional parameters as outlined in the method's signature.
Supported parameter types: string, bool, int, float,
double.
If the method has a return type, it will be printed to both the screen and the log.
- See Also
RegisterConsoleCommand<T>(string, T)
Registers your custom console command by passing a delegate.
public static void RegisterConsoleCommand<T>(string command, T callback) where T : Delegate
Parameters
command
string- The case-insensitive command to register.
callback
T- The callback to handle the command.
Type Parameters
T
- The delegate type.
Remarks
Supported parameter types: string, bool, int, float, double.
If the delegate has a return type, it will be printed to both the screen and the log.
- See Also
RegisterConsoleCommands(Type)
Registers publicstatic methods decorated with the
ConsoleCommandAttribute within the
type
as console commands.public static void RegisterConsoleCommands(Type type)
Parameters
type
Type
Remarks
Target methods must be static.
Commands can take parameters and will respect optional parameters as outlined in the method's signature.
Supported parameter types: string, bool, int, float,
double.
If a decorated method has a return type, it will be printed to both the screen and the log.
- See Also