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
biomeNamestring- The name of the teleport. Case-insensitive, no spaces allowed.
positionVector3- 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
locationNamestring- The name of the teleport. Case-insensitive, no spaces allowed.
positionVector3- The world coordinates of the teleport.
RegisterConsoleCommand(string, Type, string, Type[])
public static void RegisterConsoleCommand(string command, Type declaringType, string methodName, Type[] parameters)
Parameters
commandstring- The case-insensitive command to register.
declaringTypeType- The declaring type that holds the method to call when the command is entered.
methodNamestring- The name of the method to call within the declaring type when the command is entered. Method must be static.
parametersType[]- 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
commandstring- The case-insensitive command to register.
callbackT- 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 public static methods decorated with the
ConsoleCommandAttribute within the
type as console commands.public static void RegisterConsoleCommands(Type type)
Parameters
typeType
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