コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }