Exemplo n.º 1
0
 public static void PlayOneShot(string eventName, Vector3 position, bool local, float maxDistance)
 {
     if (BoltNetwork.isRunning)
     {
         foreach (BoltEntity current in Scene.SceneTracker.allPlayerEntities)
         {
             if ((current.transform.position - position).sqrMagnitude < maxDistance * maxDistance)
             {
                 FMODNetworkedAudio.SendEvent(eventName, position, current.source);
             }
         }
     }
     if (local)
     {
         FMODCommon.PlayOneshot(eventName, position, new object[0]);
     }
 }
Exemplo n.º 2
0
 public static void PlayOneShotParameter(string eventName, Vector3 position, int index, float value, bool local, float maxDistance)
 {
     if (BoltNetwork.isRunning)
     {
         foreach (BoltEntity current in Scene.SceneTracker.allPlayerEntities)
         {
             if ((current.transform.position - position).sqrMagnitude < maxDistance * maxDistance)
             {
                 FMODNetworkedAudio.SendEvent(eventName, position, current.source, index, value);
             }
         }
     }
     if (local)
     {
         FMOD_StudioSystem.instance.PlayOneShot(eventName, position, delegate(EventInstance eventInstance)
         {
             eventInstance.setParameterValueByIndex(index, value);
             return(true);
         });
     }
 }