/// <summary> /// Used for the singleton pattern. /// </summary> private void Awake() { if (singleton != null) { Destroy(singleton.gameObject); } singleton = this; }
/// <summary> /// Stops playing the current sound. /// </summary> public void StopSound() { SendBytePacket(PacketType.Stop, DeliveryMethod.ReliableOrdered); SoundLibrary.StopSound(); }
/// <summary> /// Sends a sound to peers. /// </summary> /// <param name="number">The type of sound to be sent.</param> public void SendSound(int number = 1) { SendIntPacket(number, PacketType.Sounds, DeliveryMethod.ReliableOrdered); SoundLibrary.SoundSent(number); }