A class in Root.Township, the global namespace.
One hand of a player: the network behaviour that holds the grip point, the Hand, the input and the controller extensions such as the Interactor. Both sides; reach one through PlayerController.LeftController or RightController.
Constructors
| Member | What it is |
|---|
Controller() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|
private List<ControllerExtension> allExtensions | Unused list; AllExtensions has its own backing. |
private List<ControllerExtension> existingExtensions | Extensions already on the prefab, added to AllExtensions first. |
private ControllerExtensionGroup extensionsGroup | Extension group added for every player. |
private Transform extensionsOnIKHand | The IK hand copy of extensionsGroup, moved by MoveExtensionsObjects. |
private Transform gripPoint | Backing field for GripPoint. |
private Hand hand | Backing field for Hand. |
private Interactor interactor | Cached interactor extension, found on first use. |
private ControllerExtensionGroup localExtensionsGroup | Extension group added only for the local player (formerly ownedExtensionsGroup). |
private NetworkTransform networkTransform | Cached network transform, found on first use. |
private Transform ownedExtensionsOnIKHand | The IK hand copy of localExtensionsGroup, if any. |
Properties
Methods
| Member | What it is |
|---|
T GetControllerExtension<T>() | Returns the first extension of the given type, or null with a warning. |
void Initialize(PlayerController controller, PlayerInput input) | Links the hand to its player controller and input, spawns extension groups (local-only ones only for the local player) and initializes them. |
void MoveExtensionsObjects(bool isToMasterHand) | Reparents the IK-hand extension objects to the master hand root or the IK hand root. |
override void OnConnected(Player player) | Calls OnConnectedToPlayer on every extension one frame later. |
void TriggerHaptic(float strength, float duration, float frequency = 80) | Vibrates this hand's controller, by strength and duration or by a curve. The strength version only acts on clients. |
void TriggerHaptic(AnimationCurve curve, float strength = 1, float frequency = 80) | Vibrates this hand's controller, by strength and duration or by a curve. The strength version only acts on clients. |
bool TryGetHeldPickup(out Pickup pickup) | Returns the pickup this hand is holding, if the interactor is holding a Pickup. |
4 private and internal methods
| Member | What it is |
|---|
private void AddExtension(ControllerExtensionGroup group) | Instantiates an extension group twice, once for the ghost hand and once for the IK hand. |
private void CreateExtensionObject(ControllerExtensionGroup group, bool isIKHand) | Instantiates an extension group under the master or IK hand root, keeping only the components meant for that hand and linking them to this controller. |
private void OnDestroy() | Unlinks the actions manager and clears the input's target transform if it pointed here. |
private bool SetupGripPointRigidbody() | Editor apply method: makes sure the grip point has a kinematic rigidbody. |
Used in
Members of other types that take, return or hold a Controller:
CharacterCollisionController.CollidersToDisableWhenInteracting.controller, CharacterCollisionController.CollidersToDisableWhenInteracting.Controller, GhostHandController.controller, GhostHandController.Controller, Hand.controller, Hand.Controller, Hand.SetupWithController, HandStore.HandStore, HandStore.sourceController, LandmarkDebugger.Run, SceneWidgetsAction.Run, Inventory.AddHandItem, PickupDock.TriggerHaptic, PickupDock.TriggerHoverHaptic, QamOptionAsButtonCommand.GetControllerHack, BoneWeightTestsMenuAction.Run, DebugLightMenuAction.Run, DecreaseHeightMenuAction.Run, EmptyMenu.Run, EquipmentModeQuickAccess.Run, MemoryDumpMenuAction.Run, MicMuteQuickAccessAction.Run, MODSMicMuteQuickAccessAction.Run, MuteNonFriendsQuickAccessAction.Run, NestingMenuAction.Run, PhysicsFPSMenuAction.Run, QuickAccessMenuAction.Run, QuickAccessMenuBubble.Run, ReturnToMainMenuAction.Run, SettingsQuickAccessMenu.Run, ShowNames.Run, SummonActionItemQuickAccess.Run, ToggleAccessibleDockMenuAction.Run, ToggleDebugMovementMenuAction.Run, ToggleEnemyHealthBars.Run, ToggleLiveDataDisplayMenuAction.Run, ToggleLocalSpeedMenuAction.Run, ToggleRuntimeConsole.Run, ToggleRuntimeConsole.UpdateConsolePosition, TriggerDebugSetSpawnMenuAction.Run, UpdateFarClipMenuAction.Run, UpdateHeightMenuAction.Run, VivoxConnectionQuickAccessAction.Run, SummonCameraQuickAccess.Run, CharacterInfo.LeftController, CharacterInfo.RightController, ClimberSettings.GetHapticOverUpwardAlignment, ClimberSettings.GetHapticStrengthOverDistance, ControllerExtension.controller, ControllerExtension.Controller, ControllerInputButtonPressed.controller, ControllerMod.RunMod, CustomFixedJoint.Controller, CustomizationPlayerController.SetupController, EmptyJoint.Controller, ClimbingHand.ClimbingHand, ClimbingHand.Controller, HandGestureTrigger.CleanController, HandGestureTrigger.TrackController, HandHandler.Controller and 13 more.