protected override void OnRender(ClientEffectEntity entity) { var comp = entity.logic; if (!entity.assets.IsInitialized) { entity.assets.IsInitialized = true; comp.EffectLogic.Initialize(entity); if (entity.hasAudio) { var audioEfcType = (AudioClientEffectType)entity.audio.AudioClientEffectType; switch (audioEfcType) { case AudioClientEffectType.BulletHit: GameAudioMedia.PlayHitEnvironmentAudio((AudioGrp_HitMatType)entity.audio.AudioClientEffectArg1, entity.position.Value); break; case AudioClientEffectType.BulletDrop: GameAudioMedia.PlayBulletDropAudio(entity.audio.AudioClientEffectArg1, (AudioGrp_FootMatType)entity.audio.AudioClientEffectArg2, entity.position.Value); break; case AudioClientEffectType.ThrowExplosion: GameAudioMedia.PlayEventAudio(entity.audio.AudioClientEffectArg1, entity.position.Value); break; } } } else { comp.EffectLogic.Render(entity); } }
private void Initialize(ClientEffectEntity entity) { entity.assets.IsInitialized = true; entity.logic.EffectLogic.Initialize(entity); if (entity.hasAudio) { var audioEfcType = (AudioClientEffectType)entity.audio.AudioClientEffectType; switch (audioEfcType) { // case AudioClientEffectType.WeaponEnvHit: // // GameAudioMedia.PlayHitEnvironmentAudio((AudioGrp_HitMatType)entity.audio.AudioClientEffectArg1, // // entity.audio.AudioClientEffectArg2,entity.position.Value); // // _logger.Info("Real Play Time:"+(_playerContext.flagSelfEntity.time.ClientTime - GlobalConst.BeforeAttackTime)); // break; case AudioClientEffectType.WeaponPlayerHit: GameAudioMedia.PlayHitPlayerAudio((EBodyPart)entity.audio.AudioClientEffectArg1, entity.audio.AudioClientEffectArg2, entity.position.Value); break; case AudioClientEffectType.BulletDrop: GameAudioMedia.PlayBulletDropAudio(entity.audio.AudioClientEffectArg1, (AudioGrp_FootMatType)entity.audio.AudioClientEffectArg2, entity.position.Value); break; case AudioClientEffectType.ThrowExplosion: GameAudioMedia.PlayEventAudio(entity.audio.AudioClientEffectArg1, entity.position.Value); break; } } }
public void OnLoadSucc(BulletEntity bullet, UnityObject unityObj) { if (null != bullet) { bullet.AddBulletGameObject(unityObj); if (unityObj.AudioMono == null) { unityObj.AudioMono = unityObj.AsGameObject.AddComponent <AkGameObj>(); } GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.BulletFly, unityObj.AudioMono as AkGameObj, true); } }
public void OnLoadSucc(BulletEntity bullet, UnityObject unityObj) { if (null != bullet && unityObj != null && unityObj.AsGameObject) { if (GMVariable.NeedBulletFlyLog) { Object res = UnityEditor.AssetDatabase.LoadAssetAtPath <Object>("Assets/Assets/CoreRes/Sound/Model/Sphere.prefab"); var clone = GameObject.Instantiate(res) as GameObject; unityObj.AsObject = clone; } bullet.AddBulletAsset(unityObj); if (unityObj.AudioMono == null) { unityObj.AudioMono = unityObj.AsGameObject.AddComponent <AkGameObj>(); } GameAudioMedia.PlayEventAudio((int)EAudioUniqueId.BulletFly, unityObj.AudioMono as AkGameObj, true); } }