public override void Update(IUserCmd cmd) { if (entity.playerClientUpdate.HasFootstepFrame) { entity.playerClientUpdate.FootstepFrameGroup = (short)AudioGrp_Footstep.None; } var audioMgr = AkSoundEngineController.AudioMgrGetter; if (audioMgr == null) { return; } if (!audioMgr.battleListener.HasParent && PlayerObject) { audioMgr.battleListener.SetPartent(PlayerObject.transform); MapAmbInfo ambInfo; Wwise_IDs.GetMapAmb(mapId, out ambInfo); ambInfo.PlayAmb(); } audioMgr.PlayAmbient(); /*if (!entity.WeaponController().IsWeaponSlotEmpty(EWeaponSlotType.TacticWeapon)) * { * if (Time.time - entity.playerAudio.C4UnityStamp >= 1) * { * entity.playerAudio.C4UnityStamp = Time.time; * * PlaySimpleAudio(EAudioUniqueId.C4_Alarm); * } * }*/ // // if (entity.StateInteractController().UserInput.IsInput(EPlayerInput.IsReloadInterrupt)) // { // StopPullBoltAudio(); // } base.Update(cmd); #if UNITY_EDITOR audioMgr.battleListener.ThdViewEmitter.transform.localPosition = GlobalConst.ThrdEmitterDistanceDelta; audioMgr.battleListener.ThdViewEmitter.transform.LookAt( audioMgr.battleListener.DefaultListenerObj.transform); audioMgr.battleListener.FstViewEmitter.transform.localPosition = GlobalConst.FstEmitterDistanceDelta; audioMgr.battleListener.FstViewEmitter.transform.LookAt( audioMgr.battleListener.DefaultListenerObj.transform); #endif }
/// <summary> /// 加载环境特效 /// </summary> /// <param name="assetManager"></param> public override void LoadMapAmbient(IUnityAssetManager assetManager) { _logger.Info("Req Load Map Amb "); MapAmbInfo ambInfo; Wwise_IDs.GetMapAmb(mapId, out ambInfo); if (ambInfo.Id > 0 && !string.IsNullOrEmpty(ambInfo.EnvironmentAmb)) { GameAudioMedia.LoadSimpleBank(string.Format("Map_{0}", mapId), AudioBank_LoadMode.Aync, (akresult) => { if (akresult.Sucess()) { _logger.Info("try Load Map Amb " + ambInfo.EnvironmentAmb); assetManager.LoadAssetAsync(entity, new AssetInfo(MapAmbInfo.AssetName, ambInfo.EnvironmentAmb), OnLoadMapAmbientSucess); } }); } }