HapticWhileHeld
A class in Root.Township, Alta.Pages.
Component that buzzes the holding hand's controller every frame while its Pickup is held. Client side.
- Listed in Items, inventory and logic
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
HapticWhileHeld() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private AltaCoroutine haptic | The running haptic coroutine, if any. |
private Pickup pickup | Backing field for Pickup. |
private float strength | Backing field for Strength. |
Properties
| Member | What it is |
|---|---|
Pickup Pickup { get; set; } | The pickup to watch. Found on the same object by default. |
float Strength { get; set; } | Haptic strength sent to the controller. |
Methods
5 private and internal methods
| Member | What it is |
|---|---|
private IEnumerator Haptic() (iterator) | Coroutine that triggers a haptic pulse of strength on every interactor's controller each frame. |
private void InteractionEnded(Interactable arg1, Interactor arg2) | Stops the haptic coroutine when the pickup is let go. |
private void InteractionStarted(Interactable arg1, Interactor arg2) | Restarts the haptic coroutine when the pickup is grabbed. |
private void OnDisable() | Unhooks from the pickup's interaction events. |
private void OnEnable() | Hooks the pickup's interaction events, starting the buzz at once if it is already held. |