Skip to main content

CustomizationPlayerController

A class in Root.Township, the global namespace.

The player controller used in the character customization room: always local and alive, with smooth locomotion, and it hides ghost hands while holding customization pickups. Client side.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private Transform headBacking field for Head.
private bool isHidingGhostHandsOnInteractWhether ghost hands hide while holding customization pickups.
private ColliderGroup leftGhostHandCollidersLeft ghost hand colliders, turned off while that hand holds something.
private ColliderGroup rightGhostHandCollidersRight ghost hand colliders, turned off while that hand holds something.
private CustomizationStateSettings settingsCustomization state settings, used for the room position.

Properties​

MemberWhat it is
override Transform Head { get; }The head transform set in the inspector.
override Transform HeadFollow { get; }Same as Head.
override bool IsLocalPlayer { get; }Always true.

Methods​

MemberWhat it is
protected override void Awake()Marks the controller alive.
protected override void DelayReposition()Moves the player to the customization room position from settings.
protected override void OnDestroy()Also destroys the smooth locomotion object.
6 private and internal methods
MemberWhat it is
private ColliderGroup GetHandCollidersForInteractor(Interactor interactor)Returns the ghost hand collider group for the interactor's hand.
private void OnControllerInteractionEnd(Interactor interactor, Interactable interactable)Shows the ghost hand and turns its colliders back on when an interaction ends.
private void OnControllerInteractionStart(Interactor interactor, Interactable interactable)Hides the ghost hand for customization pickups and turns off that hand's colliders.
private void SetGhostHandStateForInteraction(Interactor interactor, Interactable interactable, bool enabled)Turns the ghost hand renderers on or off when the interactable is a CustomizationPickup and hiding is enabled.
private void SetupController(Controller controller)Hooks a hand controller's interaction events and limits its pointer around this transform.
private void Start()Sets up both hand controllers.

Used in​

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