コード例 #1
0
        private void PlayOneEffect(ThrowingEntity throwing, int effectId, Vector3 effectPos, bool isBomb)
        {
            var entityIdGenerator = _contexts.session.commonSession.EntityIdGenerator;

            EClientEffectType effectType = EClientEffectType.GrenadeExplosion;
            int effectTime  = _bombEffectTime;
            var bombAudioId = Core.EAudioUniqueId.GrenadeExplosion;

            if (isBomb)
            {
                //爆炸特效类型
                switch ((EWeaponSubType)throwing.throwingData.WeaponSubType)
                {
                case EWeaponSubType.Grenade:
                    effectType = EClientEffectType.GrenadeExplosion;
                    break;

                case EWeaponSubType.FlashBomb:
                    effectType  = EClientEffectType.FlashBomb;
                    bombAudioId = Core.EAudioUniqueId.FlashBombExplosion;
                    break;

                case EWeaponSubType.FogBomb:
                    effectType  = EClientEffectType.FogBomb;
                    bombAudioId = Core.EAudioUniqueId.FoggyBombExplosion;
                    effectTime  = _fogBombEffectTime;
                    break;

                case EWeaponSubType.BurnBomb:
                    effectType = EClientEffectType.BurnBomb;
                    break;
                }
            }
            else
            {
                bombAudioId = EAudioUniqueId.None;
            }
            if (effectId > 0)
            {
                float effectYaw    = throwing.throwingData.IsFly ? 0 : 1;
                var   effectEntity = ClientEffectFactory.CreateGrenadeExplosionEffect(_contexts.clientEffect, entityIdGenerator,
                                                                                      throwing.ownerId.Value, effectPos, effectYaw, 0, effectId, effectTime, effectType);
                if (effectEntity.hasAudio)
                {
                    effectEntity.RemoveAudio();
                }
                effectEntity.AddAudio((int)AudioClientEffectType.ThrowExplosion);
                effectEntity.audio.AudioClientEffectArg1 = (int)bombAudioId;
            }
        }
コード例 #2
0
        private void CreatePullBoltEffect(PlayerWeaponController controller)
        {
            if (null == controller)
            {
                Logger.Error("player state owner is not player or null !");
                return;
            }

            var   effectPos   = SingletonManager.Get <ThrowAmmunitionCalculator>().GetFireViewPosition(controller);
            float effectYaw   = (controller.RelatedOrientation.Yaw + 90) % 360;
            float effectPitch = controller.RelatedOrientation.Pitch;
            int   effectId    = 32;
            int   effectTime  = 3000;

            ClientEffectFactory.CreateGrenadeExplosionEffect(_context, _idGenerator, controller.Owner, effectPos,
                                                             effectYaw, effectPitch, effectId, effectTime, EClientEffectType.PullBolt);
        }
コード例 #3
0
        public void PlayPullBoltEffect(PlayerWeaponController controller)
        {
            if (null == controller)
            {
                Logger.Error("player state owner is not player or null !");
                return;
            }

            var   effectPos   = PlayerEntityUtility.GetThrowingEmitPosition(controller);
            float effectYaw   = (controller.RelatedOrient.Yaw + 90) % 360;
            float effectPitch = controller.RelatedOrient.Pitch;
            int   effectId    = 32;
            int   effectTime  = 3000;

            ClientEffectFactory.CreateGrenadeExplosionEffect(_context, _idGenerator,
                                                             controller.Owner, effectPos, effectYaw, effectPitch, effectId, effectTime, EClientEffectType.PullBolt);
        }
コード例 #4
0
        public void PlayPullBoltEffect(IPlayerWeaponState playerState)
        {
            var player = playerState.Owner as PlayerEntity;

            if (null == player)
            {
                Logger.Error("player state owner is not player or null !");
                return;
            }

            var   owner       = player.entityKey.Value;
            var   effectPos   = PlayerEntityUtility.GetThrowingEmitPosition(player);
            float effectYaw   = (playerState.ViewYaw + 90) % 360;
            float effectPitch = playerState.ViewPitch;
            int   effectId    = 32;
            int   effectTime  = 3000;

            ClientEffectFactory.CreateGrenadeExplosionEffect(_context, _idGenerator,
                                                             owner, effectPos, effectYaw, effectPitch, effectId, effectTime, EClientEffectType.PullBolt);
        }
コード例 #5
0
        private void PlayOneEffect(ThrowingEntity throwing, int effectId, Vector3 effectPos, bool isBomb)
        {
            var entityIdGenerator = _contexts.session.commonSession.EntityIdGenerator;


            EClientEffectType effectType = EClientEffectType.GrenadeExplosion;
            int effectTime = _bombEffectTime;

            if (isBomb)
            {
                //爆炸特效类型
                switch ((EWeaponSubType)throwing.throwingData.WeaponSubType)
                {
                case EWeaponSubType.Grenade:
                    effectType = EClientEffectType.GrenadeExplosion;
                    break;

                case EWeaponSubType.FlashBomb:
                    effectType = EClientEffectType.FlashBomb;
                    break;

                case EWeaponSubType.FogBomb:
                    effectType = EClientEffectType.FogBomb;
                    effectTime = _fogBombEffectTime;
                    break;

                case EWeaponSubType.BurnBomb:
                    effectType = EClientEffectType.BurnBomb;
                    break;
                }
            }

            if (effectId > 0)
            {
                float effectYaw = throwing.throwingData.IsFly ? 0 : 1;
                ClientEffectFactory.CreateGrenadeExplosionEffect(_contexts.clientEffect, entityIdGenerator,
                                                                 throwing.ownerId.Value, effectPos, effectYaw, 0, effectId, effectTime, effectType);
            }
        }