Skip to main content

ServerCommandAction

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​

MemberWhat it is
ServerCommandAction()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private TextRenderer buttonTextText showing the command's name.
private ServerCommandDefinitionBase commandThe command definition this button runs.
private float minDelayBetweenCommandsCooldown in seconds after a command. Default 0.5.
private static float nextCommandStatic time before which no button of this type can send again.

Methods​

MemberWhat 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.