Exemplo n.º 1
0
 /// <summary>
 /// Used for the singleton pattern.
 /// </summary>
 private void Awake()
 {
     if (singleton != null)
     {
         Destroy(singleton.gameObject);
     }
     singleton = this;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Stops playing the current sound.
 /// </summary>
 public void StopSound()
 {
     SendBytePacket(PacketType.Stop, DeliveryMethod.ReliableOrdered);
     SoundLibrary.StopSound();
 }
Exemplo n.º 3
0
 /// <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);
 }