private static void HandleMessage(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <EntitySoundManager.EntitySoundMessage>(EntitySoundManager.sharedMessage);
     if (EntitySoundManager.sharedMessage.networkIdentity)
     {
         EntitySoundManager.EmitSoundLocal(NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(EntitySoundManager.sharedMessage.networkSoundEventIndex), EntitySoundManager.sharedMessage.networkIdentity.gameObject);
     }
     EntitySoundManager.sharedMessage.Clear();
 }
        private static void Init()
        {
            List <NetworkSoundEventDef> list = new List <NetworkSoundEventDef>();

            list.AddRange(Resources.LoadAll <NetworkSoundEventDef>("NetworkSoundEventDefs/"));
            Action <List <NetworkSoundEventDef> > action = NetworkSoundEventCatalog.getSoundEventDefs;

            if (action != null)
            {
                action(list);
            }
            NetworkSoundEventCatalog.SetNetworkSoundEvents(list);
        }
        // Token: 0x060026F7 RID: 9975 RVA: 0x000A9ACC File Offset: 0x000A7CCC
        public static void EmitSoundServer(NetworkSoundEventIndex networkSoundEventIndex, GameObject gameObject)
        {
            NetworkIdentity component = gameObject.GetComponent <NetworkIdentity>();

            if (!component)
            {
                Debug.LogWarningFormat("Cannot emit sound \"{0}\" on object \"{1}\": Object has no NetworkIdentity.", new object[]
                {
                    NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(networkSoundEventIndex),
                    gameObject
                });
                return;
            }
            EntitySoundManager.EmitSoundServer(networkSoundEventIndex, component);
        }
        // Token: 0x060026F6 RID: 9974 RVA: 0x000A9A84 File Offset: 0x000A7C84
        public static void EmitSoundServer(AkEventIdArg akEventId, GameObject gameObject)
        {
            NetworkSoundEventIndex networkSoundEventIndex = NetworkSoundEventCatalog.FindNetworkSoundEventIndex(akEventId);

            if (networkSoundEventIndex == NetworkSoundEventIndex.Invalid)
            {
                Debug.LogWarningFormat("Cannot emit sound \"{0}\" on object \"{1}\": Event is not registered in NetworkSoundEventCatalog.", new object[]
                {
                    akEventId.id,
                    gameObject
                });
                return;
            }
            EntitySoundManager.EmitSoundServer(networkSoundEventIndex, gameObject);
        }
Example #5
0
 private static void HandleMessage(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <PointSoundManager.NetworkSoundEventMessage>(PointSoundManager.sharedMessage);
     PointSoundManager.EmitSoundLocal(NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(PointSoundManager.sharedMessage.soundEventIndex), PointSoundManager.sharedMessage.position);
 }