A class in Root.Township, the global namespace.
Client-side component that plays a sound when its pickup is docked or undocked by a player. Removes itself on a headless server.
Constructors
| Member | What it is |
|---|
PickupDockingSoundPlayer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private SoundEffectSet docking | Sound set for docking. |
private SoundEffect dockingSound | Old single docking sound, migrated into docking. Still the one actually played. |
private Pickup pickup | The pickup on the same object. |
private SoundEffectSet undocking | Sound set for undocking. |
private SoundEffect undockingSound | Old single undocking sound, migrated into undocking. Still the one actually played. |
Methods
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Destroys the component on a headless server. |
private void OnDisable() | Unhooks the dock events. |
private void OnEnable() | Hooks the pickup's Docked and Undocked events. |
private void PlayDockingSound(Interactor interactor, Pickup pickup, PickupDock dock) | If an interactor did it, plays the docking or undocking sound at the pickup, depending on whether it's now in a dock. |