Skip to main content

MainMenuPlayerController

A class in Root.Township, the global namespace.

Client: the VR player in the main menu. A smooth locomotion player with its own head and inputs that is not linked to a networked player.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private FingerTipSettings fingerTipsBacking field for the fingertip settings.
private Transform headBacking field for Head.
private ColliderGroup leftGhostHandCollidersLeft hand colliders, off while the hand holds something.
private PlayerInput leftInputBacking field for LeftInput.
private ColliderGroup rightGhostHandCollidersRight hand colliders, off while the hand holds something.
private PlayerInput rightInputBacking field for RightInput.

Properties​

MemberWhat it is
override Transform Head { get; }The menu player's head transform.
override Transform HeadFollow { get; }Same as Head.
bool IsLoaded { get; }Always true.
PlayerInput LeftInput { get; }Left hand input.
PlayerController PlayerController { get; }This controller.
PlayerMode PlayerMode { get; }The current player mode from PlayerModeUtilities.
Transform PlayerTransform { get; }This object's transform.
PlayerInput RightInput { get; }Right hand input.
1 private and internal property
MemberWhat it is
private FingerTipSettings IHasFingertips.FingerTips { get; }Fingertip settings for the menu hands.

Methods​

MemberWhat it is
void SetControls()Adds the default controller modes to both hands.
protected override void Awake()Marks the player alive and sets up both hand inputs.
5 private and internal methods
MemberWhat it is
private ColliderGroup GetHandCollidersForInteractor(Interactor interactor)Returns the ghost hand colliders for the left or right interactor.
private void OnControllerInteractionEnd(Interactor interactor, Interactable interactable)Turns the hand's ghost colliders back on when it lets go.
private void OnControllerInteractionStart(Interactor interactor, Interactable interactable)Turns the hand's ghost colliders off while it holds or uses something.
private void IPlatformPlayer.OnDisconnectedFromPlatform()Unlinks the inputs and fades the screen to black.
private void Start()Links the inputs with no network player and hooks both interactors.

Used in​

Members of other types that take, return or hold a MainMenuPlayerController: