A class in Root.Township, Alta.Menu.
Client menu button that runs one server command definition, with a short cooldown shared by all such buttons.
Constructors
| Member | What it is |
|---|
ServerCommandAction() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private TextRenderer buttonText | Text showing the command's name. |
private ServerCommandDefinitionBase command | The command definition this button runs. |
private float minDelayBetweenCommands | Cooldown in seconds after a command. Default 0.5. |
private static float nextCommand | Static time before which no button of this type can send again. |
Methods
| Member | What it is |
|---|
void SendCommand() | Runs the command unless the shared cooldown is still running, then restarts the cooldown. |
override void SetSettings(ISettingsFieldAccess newSettingToDisplay) | Takes the command definition and shows its display name on the button. |