Skip to content

ControlUse

public sealed class ControlUse

Namespace Chassis.Api

Added in 1.2.0

A switch in a cockpit was used, from ChassisApi.ControlUsed and the handlers of ChassisApi.RegisterControlAction.

public LandVehicle Vehicle { get; internal set; }

Added in 1.2.0

The vehicle the switch is in.

public ControlProfile Control { get; internal set; }

Type: ControlProfile

Added in 1.2.0

The switch, from the vehicle’s profile.

public string Action { get; internal set; }

Added in 1.2.0

The switch’s action, e.g. “lights” or “mymod.siren”.

public float Value { get; internal set; }

Added in 1.2.0

The new value: 1 for a button, 0 or 1 for a toggle, the knob’s new position.

public Player By { get; internal set; }

Added in 1.2.0

The player who used it, or null when a mod called ChassisApi.UseControl.

public bool IsHost { get; internal set; }

Added in 1.2.0

True on the host. Do work that changes the world only where this is set; the handler runs on every peer.