BaseChairclass

objectComponentBaseChair
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.BaseChair : Sandbox.Component

Constructors1

Showing 1 constructors

Methods15

Showing 15 methods

public virtual sealed void AskToLeave(Sandbox.PlayerController player)PUBLICVIRTUAL

Called on the host to request leaving the chair.

ParameterTypeDescription
playerPlayerController
Returns:void

public virtual bool CanEnter(Sandbox.PlayerController player)PUBLICVIRTUAL

Return true if this player can enter the chair

ParameterTypeDescription
playerPlayerController
Returns:bool

public virtual bool CanLeave(Sandbox.PlayerController player)PUBLICVIRTUAL

Return true if this player can leave the chair

ParameterTypeDescription
playerPlayerController
Returns:bool

public virtual sealed bool CanPress(Sandbox.Component.IPressable.Event e)PUBLICVIRTUAL

Chair is usable if the player can enter

ParameterTypeDescription
eEvent
Returns:bool

protected void ClampEyes(Sandbox.PlayerController controller)PROTECTED

Clamps the eye angles of a seated player between the PitchRange and YawRange

ParameterTypeDescription
controllerPlayerController
Returns:void

protected virtual void DrawGizmos()PROTECTEDVIRTUAL

Draws the player model sitting in the chair if it's selected

Returns:void

public void Eject(Sandbox.PlayerController player)PUBLIC

Called on the client to eject the player from the chair.

ParameterTypeDescription
playerPlayerController
Returns:void

public Vector3 FindBestExitPoint()PUBLIC

Returns a position to place the player when they exit the chair. This searches through ExitPoints to find the best one, which is usually the one the player is most facing towards.

Returns:Vector3

public virtual Transform GetEyeTransform()PUBLICVIRTUAL

Get the transform representing the eye position when seated

Returns:Transform

public virtual sealed bool Press(Sandbox.Component.IPressable.Event e)PUBLICVIRTUAL

Called when the player has pressed to use the chair. Only called if CanPress returned true.

ParameterTypeDescription
eEvent
Returns:bool

public void Sit(Sandbox.PlayerController player)PUBLIC

Called on the client to place the player in the chair.

ParameterTypeDescription
playerPlayerController
Returns:void

Properties11

Showing 11 properties

public bool Sandbox.BaseChair.IsOccupied { get; set; }PUBLICGETSET

Returns true if the chair is currently occupied

Returns:bool

public Vector2 Sandbox.BaseChair.PitchRange { get; set; }PUBLICGETSET

Pitch range for seated players

Returns:Vector2

public Sandbox.GameObject Sandbox.BaseChair.SeatPosition { get; set; }PUBLICGETSET

A GameObject representing the seat position

Returns:GameObject

public float Sandbox.BaseChair.SitHeight { get; set; }PUBLICGETSET

Height offset for sitting position, from -1 (lowest) to 1 (highest)

Returns:float

public string Sandbox.BaseChair.TooltipDescription { get; set; }PUBLICGETSET

A longer description for this chair's tooltip.

Returns:string

public string Sandbox.BaseChair.TooltipIcon { get; set; }PUBLICGETSET

The icon for this chair's tooltip. Either Material Icons or an Emoji.

Returns:string

public string Sandbox.BaseChair.TooltipTitle { get; set; }PUBLICGETSET

The title of this chair's tooltip. Empty to disable.

Returns:string

On this page

Constructorspublic BaseChair()Methodspublic virtual sealed System.Void AskToLeave(Sandbox.PlayerController player)public virtual Transform CalculateEyeTransform(Sandbox.PlayerController controller)public virtual System.Boolean CanEnter(Sandbox.PlayerController player)public virtual System.Boolean CanLeave(Sandbox.PlayerController player)public virtual sealed System.Boolean CanPress(Sandbox.Component.IPressable.Event e)protected System.Void ClampEyes(Sandbox.PlayerController controller)protected virtual System.Void DrawGizmos()public System.Void Eject(Sandbox.PlayerController player)public Vector3 FindBestExitPoint()public virtual Transform GetEyeTransform()public Sandbox.PlayerController GetOccupant()public virtual System.Nullable`1<Sandbox.Component.IPressable.Tooltip> GetTooltip(Sandbox.Component.IPressable.Event e)public virtual sealed System.Boolean Press(Sandbox.Component.IPressable.Event e)public System.Void Sit(Sandbox.PlayerController player)public virtual System.Void UpdatePlayerAnimator(Sandbox.PlayerController controller, Sandbox.SkinnedModelRenderer renderer)Propertiespublic Sandbox.GameObject[] Sandbox.BaseChair.ExitPoints { get; set; }public Sandbox.GameObject Sandbox.BaseChair.EyePosition { get; set; }public System.Boolean Sandbox.BaseChair.IsOccupied { get; set; }public Vector2 Sandbox.BaseChair.PitchRange { get; set; }public Sandbox.GameObject Sandbox.BaseChair.SeatPosition { get; set; }public System.Single Sandbox.BaseChair.SitHeight { get; set; }public Sandbox.BaseChair.AnimatorSitPose Sandbox.BaseChair.SitPose { get; set; }public System.String Sandbox.BaseChair.TooltipDescription { get; set; }public System.String Sandbox.BaseChair.TooltipIcon { get; set; }public System.String Sandbox.BaseChair.TooltipTitle { get; set; }public Vector2 Sandbox.BaseChair.YawRange { get; set; }Metadata