A class in Root.Township, the global namespace.
Client: on a pickup, buzzes the holding controllers when it hits another pickup fast enough. Removed on headless servers.
Constructors
| Member | What it is |
|---|
CollisionHaptic() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private float hapticAmount | Haptic strength. |
private float hapticDuration | Haptic length in seconds. |
private float minimumSpeedForHapticsSquared | Squared speed both pickups together must pass. |
private Pickup pickup | The pickup on this object. |
Methods
| Member | What it is |
|---|
void Haptics() | Plays a flat haptic pulse on every controller holding this pickup. |
2 private and internal methods
| Member | What it is |
|---|
private void Awake() | Destroys itself on a headless build. |
private void OnCollisionEnter(Collision collision) | If it hit a pickup (or the root of a crafted one) and their summed squared speeds pass the minimum, runs Haptics. |