Skip to main content

PickupDockingSoundPlayer

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.

  • Listed in Global namespace: P
  • Inherits or implements MonoBehaviour
  • Attributes RequireComponent

Constructors​

MemberWhat it is
PickupDockingSoundPlayer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private SoundEffectSet dockingSound set for docking.
private SoundEffect dockingSoundOld single docking sound, migrated into docking. Still the one actually played.
private Pickup pickupThe pickup on the same object.
private SoundEffectSet undockingSound set for undocking.
private SoundEffect undockingSoundOld single undocking sound, migrated into undocking. Still the one actually played.

Methods​

4 private and internal methods
MemberWhat 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.