Class ConsoleCommandAttribute
Attribute used to signify the decorated method should be called in response to a console command.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class ConsoleCommandAttribute : Attribute, _Attribute
- Inheritance
-
ConsoleCommandAttribute
- Implements
- Inherited Members
- Extension Methods
Remarks
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.
Constructors
ConsoleCommandAttribute(string)
Signifies the decorated method should be called when the given command
is entered
in the dev console.
public ConsoleCommandAttribute(string command)
Parameters
command
string- The unique, case-insensitive command that when entered into the dev console will call the decorated method.
Remarks
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)
Properties
Command
The unique, case-insensitive command that when entered, will call the decorated method.
public string Command { get; }