Beispiel #1
0
        public static AKEventCfg SimAKEventCfg2()
        {
            var co = new AKEventCfg();

            co.id          = 2;
            co.name        = "Gun_P1911_shot";
            co.bankRef     = "Weapon_Footstep";
            co.switchGroup = 11;
            return(co);
        }
Beispiel #2
0
        /// <summary>
        /// 枪械模式更换
        /// </summary>
        /// <param name="weaponState"></param>
        public static void PerformOnGunModelSwitch(CommonFireConfig comCfg, WeaponLogic.IPlayerWeaponState weaponState)
        {
            if (AudioInfluence.IsForbidden || AKAudioEntry.Dispatcher == null)
            {
                return;
            }
            // NewWeaponConfigItem weaponCfg = WeaponConfigManager.Instance.GetConfigById(weaponState.CurrentWeapon);
            //   var fireModelCfg = WeaponConfigManager.Instance.GetFireModeCountById(weaponState.CurrentWeapon);
            AKEventCfg evtCfg = AudioConfigSimulator.SimAKEventCfg1();

            testWeaponModel = testWeaponModel == "Gun_shot_mode_type_single" ? "Gun_shot_mode_type_triple" : "Gun_shot_mode_type_single";
            AKAudioEntry.Dispatcher.VarySwitchState(evtCfg.switchGroup, testWeaponModel, weaponState.CurrentWeaponGo);
        }
        public void PostEvent(int eventId, GameObject target)
        {
            AKEventCfg evtCfg = AKEventCfg.FindById(eventId);
            AKRESULT   ret    = bankLoader.TryLoadBnk(evtCfg.bankRef);

            if (ret == AKRESULT.AK_BankAlreadyLoaded || ret == AKRESULT.AK_Success)
            {
                //设置Switch初始化
                if (evtCfg.switchGroup > 0 && !typesController.IsGameObjectGroupVailed(evtCfg.switchGroup, target))
                {
                    SetSwitchDefaultState(evtCfg.switchGroup, target);
                    //  ret = typesController.IsGameObjectSwitchGroupVailed(evtCfg.switchGroup, target);
                }
                uint playingId = AkSoundEngine.PostEvent(evtCfg.name, target);
            }
            else
            {
                AKAudioEntry.AudioLogger.ErrorFormat("[Audio=>Dispather]Perform bank Load Sync fail,result:{0},bankName:{1},target:{2}", ret, evtCfg.bankRef, target);
            }
        }