Ejemplo n.º 1
0
 public void PlayEmptyFireAudio()
 {
     if (!IsOnTrigger)
     {
         IsOnTrigger = true;
         GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.EmptyFire, EmitterObject);
     }
 }
 public override void StopPullBoltAudio()
 {
     if (AkSoundEngineController.AudioMgrGetter == null)
     {
         return;
     }
     GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.MagazineStop, EmitterObject);
 }
 public override void PlayFireAudio(int weaponId, AudioGrp_ShotMode shotMode)
 {
     if (AkSoundEngineController.AudioMgrGetter == null)
     {
         return;
     }
     GameAudioMedia.PlayWeaponFireAudio(weaponId, EmitterObject, shotMode);
 }
        public override void PlayJumpStepAudio()
        {
            if (AkSoundEngineController.AudioMgrGetter == null)
            {
                return;
            }
            var footMatType = footstepCmdExec();

            GameAudioMedia.PlayJumpstepAudio(footMatType, EmitterObject);
        }
 public override void PlayReloadAuido(int weaponId, AudioGrp_Magazine magizine, float magizineSpeed)
 {
     if (AkSoundEngineController.AudioMgrGetter == null)
     {
         return;
     }
     AkSoundEngine.SetRTPCValue(Wwise_IDs.GunMagazineSpeed, magizineSpeed, EmitterObject.gameObject);
     DebugUtil.MyLog("SetRTPC:" + magizineSpeed);
     GameAudioMedia.PlayWeaponReloadAudio(weaponId, magizine, EmitterObject);
 }
Ejemplo n.º 6
0
        private void PlayReloadAuido(int weaponId, AudioGrp_Magazine magizine)
        {
            GameAudioMedia.PlayWeaponReloadAudio(weaponId, magizine, EmitterObject);
            AudioPullboltEvent pullboltEvent =
                EventInfos.Instance.Allocate(EEventType.APullbolt, false) as AudioPullboltEvent;

            pullboltEvent.Initialize(magizine, weaponId, WeaponObject.transform.position,
                                     WeaponObject.transform.eulerAngles);
            entity.localEvents.Events.AddEvent(pullboltEvent);
        }
Ejemplo n.º 7
0
        public void PlayFireAudio(int weaponId, AudioGrp_ShotMode shotMode)
        {
            GameAudioMedia.PlayWeaponFireAudio(weaponId, EmitterObject, shotMode);
            AudioWeaponFireEvent fireEvent =
                EventInfos.Instance.Allocate(EEventType.AWeaponFire, false) as AudioWeaponFireEvent;

            fireEvent.Initialize(shotMode, weaponId, WeaponObject.transform.position,
                                 WeaponObject.transform.eulerAngles);
            entity.localEvents.Events.AddEvent(fireEvent);
        }
        public override void PlayMeleeAttackAudio(int weaponId, int attackType)
        {
            if (AkSoundEngineController.AudioMgrGetter == null)
            {
                return;
            }
            int audioEventId = 0;

            GameAudioMedia.PlayMeleeAttack(weaponId, (AudioGrp_MeleeAttack)attackType, EmitterObject,
                                           ref audioEventId);
        }
Ejemplo n.º 9
0
 public void PlaySimpleAudio(EAudioUniqueId uniqueId, bool sync = false)
 {
     GameAudioMedia.PlayEventAudio((int)uniqueId, EmitterObject);
     if (sync)
     {
         AudioDefaultEvent defaultEvent =
             EventInfos.Instance.Allocate(EEventType.ADefault, false) as AudioDefaultEvent;
         defaultEvent.Initialize(uniqueId, WeaponObject.transform.position, WeaponObject.transform.eulerAngles);
         entity.localEvents.Events.AddEvent(defaultEvent);
     }
 }
 public override void PlayEmptyFireAudio()
 {
     if (AkSoundEngineController.AudioMgrGetter == null)
     {
         return;
     }
     if (!IsOnTrigger)
     {
         IsOnTrigger = true;
         GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.EmptyFire, EmitterObject);
     }
 }
Ejemplo n.º 11
0
        public void PlayJumpStepAudio()
        {
            var footMatType = FootMatType;

            GameAudioMedia.PlayJumpstepAudio(footMatType, EmitterObject);
            AudioJumpstepEvent audioEvent =
                (AudioJumpstepEvent)EventInfos.Instance.Allocate(EEventType.AJumpstep, false);

            audioEvent.Initialize(FootMatType,
                                  new Vector3(PlayerObject.transform.position.x, 0, PlayerObject.transform.position.z),
                                  PlayerObject.transform.eulerAngles);
            entity.localEvents.Events.AddEvent(audioEvent);
        }
        public override void StopSwimAudio()
        {
            var audioMgr = AkSoundEngineController.AudioMgrGetter;

            if (entity.playerAudio.InWaterState && audioMgr != null)
            {
                GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.StopSwim, audioMgr.battleListener.FstViewEmitter);
                GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.StopSwim, audioMgr.battleListener.FstViewEmitter);
                GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.StopSwim2, audioMgr.battleListener.ThdViewEmitter);
                GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.StopSwim2, audioMgr.battleListener.ThdViewEmitter);
                entity.playerAudio.InWaterState = false;
            }
        }
Ejemplo n.º 13
0
        public void PlayMeleeAttackAudio(int weaponId, int attackType)
        {
            int audioEventId = 0;

            GameAudioMedia.PlayMeleeAttack(weaponId, (AudioGrp_MeleeAttack)attackType, EmitterObject,
                                           ref audioEventId);
            if (audioEventId > 0)
            {
                AudioMeleeAtkEvent audioEvent =
                    EventInfos.Instance.Allocate(EEventType.AMeleeAttack, false) as AudioMeleeAtkEvent;
                audioEvent.Initialize(audioEventId, attackType, WeaponObject.transform.position,
                                      WeaponObject.transform.eulerAngles);
                entity.localEvents.Events.AddEvent(audioEvent);
            }
        }
        /// <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);
                    }
                });
            }
        }
        public override void PlayFootstepAudioC(AudioGrp_Footstep stepState)
        {
            if (AkSoundEngineController.AudioMgrGetter == null)
            {
                return;
            }
            var footMatType = footstepCmdExec();
            var softVal     = entity.StateInteractController().GetCurrStates().Contains(EPlayerState.Walk) ? 1 : 0;

            AkSoundEngine.SetRTPCValue(Wwise_IDs.FootstepSoft, softVal, EmitterObject.gameObject);
            GameAudioMedia.PlayFootstepAudio(stepState, footMatType, EmitterObject);
            entity.playerClientUpdate.FootstepFrameGroup = (byte)stepState;
            entity.playerClientUpdate.LastMatType        = (byte)footMatType;
            //                AudioFootstepEvent audioEvent =(AudioFootstepEvent) EventInfos.Instance.Allocate(EEventType.AFootstep, false);ErrorCode_SelectedChildNotAvailable
            //                audioEvent.Initialize(stepState, FootMatType,
            //                    new Vector3(PlayerObject.transform.position.x, 0, PlayerObject.transform.position.z),
            //                    PlayerObject.transform.eulerAngles);
            //                entity.localEvents.Events.AddEvent(audioEvent);
        }
        public override void PlaySimpleAudio(EAudioUniqueId uniqueId, bool sync = false)
        {
            if (AkSoundEngineController.AudioMgrGetter == null || SharedConfig.IsMute)
            {
                return;
            }
            switch (uniqueId)
            {
            case EAudioUniqueId.Prone:
            case EAudioUniqueId.ProneToStand:
            case EAudioUniqueId.WeaponIn:
            case EAudioUniqueId.WeaponOff:
                StopPullBoltAudio();
                break;

            case EAudioUniqueId.FlashDizzyStop:
                AkSoundEngine.SetRTPCValue(Wwise_IDs.FlashBomb, 0);
                break;
            }

            GameAudioMedia.PlayEventAudio((int)uniqueId, EmitterObject);
        }
Ejemplo n.º 17
0
 protected override void ProjectInitialize()
 {
     InitBattleListner();
     GameAudioMedia.Prepare();
     Logger.Info("[Wwise] BattleAudioManager media prepare sucess");
 }
Ejemplo n.º 18
0
 public void StopPullBoltAudio(int configId)
 {
     GameAudioMedia.StopReloadAudio(configId, EmitterObject);
 }