/// <summary> /// /// </summary> /// <param name="contexts"></param> /// <param name="entity"></param> /// <param name="e"></param> public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { if ((entity as PlayerEntity).isFlagSelf) { return; } // var controller = (entity as PlayerEntity).AudioController(); AudioEvent audioEvent = e as AudioEvent; // DebugUtil.MyLog("Play event :"+audioEvent.EventType); switch (audioEvent.EventType) { case EEventType.AFootstep: GameAudioMedia.PlayFootstepAudio(audioEvent as AudioFootstepEvent); break; case EEventType.AJumpstep: GameAudioMedia.PlayJumpstepAudio(audioEvent as AudioJumpstepEvent); break; case EEventType.AWeaponFire: GameAudioMedia.PlayWeaponFireAudio(audioEvent as AudioWeaponFireEvent); break; case EEventType.ADefault: GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent); break; case EEventType.APullbolt: GameAudioMedia.PlayWeaponReloadAudio(audioEvent as AudioPullboltEvent); break; default: break; } // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } }
/// <summary> /// /// </summary> /// <param name="contexts"></param> /// <param name="entity"></param> /// <param name="e"></param> public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { if (SharedConfig.IsMute) { return; } //var controller = (entity as PlayerEntity).AudioController(); var targetPlayerEntity = entity as PlayerEntity; int cmrEntityId = (contexts as Contexts).player.flagSelfEntity.gamePlay.CameraEntityId; // foreach(PlayerEntity playerEntity in (contexts as Contexts).player.GetEntities()) // { // if(playerEntity.gamePlay.CameraEntityId == player.entityKey.Value.EntityId) // { // //TODO // observePlayer = playerEntity; // break; // } // } AudioEvent audioEvent = e as AudioEvent; //DebugUtil.MyLog("Play other event :"+audioEvent.EventType); switch (audioEvent.EventType) { case EEventType.AFootstep: GameAudioMedia.PlayFootstepAudio(audioEvent as AudioFootstepEvent); break; case EEventType.AJumpstep: GameAudioMedia.PlayJumpstepAudio(audioEvent as AudioJumpstepEvent); break; case EEventType.AWeaponFire: GameAudioMedia.PlayWeaponFireAudio(audioEvent as AudioWeaponFireEvent); break; case EEventType.ADefault: if (cmrEntityId == targetPlayerEntity.entityKey.Value.EntityId) { float RTPCvalue = 1; GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent, RTPCvalue); break; } else { float RTPCvalue = 0; GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent, RTPCvalue); break; } case EEventType.APullbolt: GameAudioMedia.PlayWeaponReloadAudio(audioEvent as AudioPullboltEvent); break; case EEventType.AMeleeAttack: GameAudioMedia.PlayMeleeAttackAudio(audioEvent as AudioMeleeAtkEvent); break; default: break; } // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } }