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
| Member | What it is |
|---|
CustomizationPlayerController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Transform head | Backing field for Head. |
private bool isHidingGhostHandsOnInteract | Whether ghost hands hide while holding customization pickups. |
private ColliderGroup leftGhostHandColliders | Left ghost hand colliders, turned off while that hand holds something. |
private ColliderGroup rightGhostHandColliders | Right ghost hand colliders, turned off while that hand holds something. |
private CustomizationStateSettings settings | Customization state settings, used for the room position. |
Properties
| Member | What 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
| Member | What 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
| Member | What 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: