Exemplo n.º 1
0
 public static void registerEvents(this SoundBankDef bank)
 {
     bank.loaded = true;
     foreach (var ev in bank.events)
     {
         RLog.M.WL(2, "sound event:" + ev.Key + ":" + ev.Value);
         if (SceneSingletonBehavior <WwiseManager> .Instance.guidIdMap().ContainsKey(ev.Key) == false)
         {
             SceneSingletonBehavior <WwiseManager> .Instance.guidIdMap().Add(ev.Key, ev.Value);
         }
         else
         {
             SceneSingletonBehavior <WwiseManager> .Instance.guidIdMap()[ev.Key] = ev.Value;
         }
     }
 }
Exemplo n.º 2
0
        public static void setVolume(this SoundBankDef bank)
        {
            float volume = (AudioEventManager.MasterVolume / 100f);

            switch (bank.type)
            {
            case SoundBankType.Voice: volume *= (AudioEventManager.VoiceVolume / 100f) * (AudioEventManager.VoiceVolume / 100f); break;   //долбанный HBS

            case SoundBankType.Combat: volume *= (AudioEventManager.SFXVolume / 100f); break;
            }
            volume *= 100f;
            volume += bank.volumeShift;
            volume  = Mathf.Min(100f, volume);
            volume  = Mathf.Max(0f, volume);
            RLog.M.TWL(0, "SoundBankDef.setVolume " + bank.name);
            foreach (uint id in bank.volumeRTPCIds)
            {
                AKRESULT res = AkSoundEngine.SetRTPCValue(id, volume);
                RLog.M.WL(1, "SetRTPCValue " + id + " " + volume + " result:" + res);
            }
        }