3637 【前端】系统设置修改,修改特效层级ABC,增加根据质量设置改变的玩家特效播放规则
| | |
| | | originalRotX = rotationX;
|
| | | originalRotY = rotationY;
|
| | | DontDestroyOnLoad(this);
|
| | |
|
| | | SystemSetting.Instance.qualityLevelChangeEvent += QualityLevelChanged;
|
| | | }
|
| | |
|
| | | public void QualityLevelChanged()
|
| | | {
|
| | | if (CameraObject == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | }
|
| | |
|
| | | public void PlayAnimationClip(string name)
|
| | |
| | | UnityEngine.Object.Instantiate(Resources.Load<GameObject>("Prefabs/GameCamera"));
|
| | | CameraController.Instance.AcceptInput = false;
|
| | | CameraController.Instance.CameraObject.enabled = false;
|
| | | CameraController.Instance.QualityLevelChanged();
|
| | | }
|
| | |
|
| | | var hudRoot = HUDCenter.hudRoot;
|
| | |
| | |
|
| | | for (int i = 0; i < vNetData.Players.Length; ++i)
|
| | | {
|
| | | if (BattleEffectPlayRule.Instance.sortPlayerList.Contains(vNetData.Players[i]))
|
| | | {
|
| | | BattleEffectPlayRule.Instance.sortPlayerList.Remove(vNetData.Players[i]);
|
| | | }
|
| | |
|
| | | _actor = GAMgr.Instance.GetBySID(vNetData.Players[i]);
|
| | |
|
| | | if (_actor != null)
|
| | |
| | | // 异常
|
| | | }
|
| | |
|
| | | if (!BattleEffectPlayRule.Instance.sortPlayerList.Contains(vNetData.PlayerID))
|
| | | {
|
| | | BattleEffectPlayRule.Instance.sortPlayerList.Add(vNetData.PlayerID);
|
| | | }
|
| | |
|
| | | // 离线玩家
|
| | | if (vNetData.State == 1)
|
| | | {
|
| | |
| | | StatusMgr.Instance.GetBuffIds(vNetData.ObjID, ref _skill.cacheBuffList);
|
| | | _skill.OnRecv_SkillCast();
|
| | |
|
| | | // 这里播放配置的技能特效
|
| | | if (_skill.skillInfo.config.EffectName > 0)
|
| | | if (BattleEffectPlayRule.Instance.CanPlay(vNetData.ObjID))
|
| | | {
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | // 这里播放配置的技能特效
|
| | | if (_skill.skillInfo.config.EffectName > 0)
|
| | | {
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | if (_skill.warnPosList.Count > 1)
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | for (int i = 0; i < _skill.warnPosList.Count; ++i)
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _skill.warnPosList[i], Vector3.forward);
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | | else
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | if ((_skill.skillInfo.config.Tag % 10) == 0 || (_skill.skillInfo.config.Tag % 10) == 1 || _attacker is GActorNpcFight)
|
| | | if (_skill.warnPosList.Count > 1)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | for (int i = 0; i < _skill.warnPosList.Count; ++i)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _skill.warnPosList[i], Vector3.forward);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Vector3 _pos = new Vector3((vNetData.PosX - GA_Hero.MapOffset.x) * .5f,
|
| | | _attacker.Pos.y,
|
| | | (vNetData.PosY - GA_Hero.MapOffset.z) * .5f);
|
| | | if ((_skill.skillInfo.config.Tag % 10) == 0 || (_skill.skillInfo.config.Tag % 10) == 1 || _attacker is GActorNpcFight)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | }
|
| | | else
|
| | | {
|
| | | Vector3 _pos = new Vector3((vNetData.PosX - GA_Hero.MapOffset.x) * .5f,
|
| | | _attacker.Pos.y,
|
| | | (vNetData.PosY - GA_Hero.MapOffset.z) * .5f);
|
| | |
|
| | | Vector3 _dir = MathUtility.ForwardXZ(_pos, _attacker.Pos);
|
| | | Vector3 _dir = MathUtility.ForwardXZ(_pos, _attacker.Pos);
|
| | |
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName,
|
| | | _pos,
|
| | | _dir);
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName,
|
| | | _pos,
|
| | | _dir);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (_skill.skillInfo.config.EffectName != 0)
|
| | | if (BattleEffectPlayRule.Instance.CanPlay(vNetData.ObjID))
|
| | | {
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | if (_skill.skillInfo.config.EffectName != 0)
|
| | | {
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | _playEffect = false;
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | if (_playEffect)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | SFXController _controller = Play(id, parent, scale);
|
| | |
|
| | | if (_controller != null)
|
| | | {
|
| | | _controller.gameObject.SetLayer(LayerUtility.BattleEffect, true);
|
| | | }
|
| | |
|
| | | return _controller;
|
| | | }
|
| | |
|
| | |
| | | public SFXController PlayBattleEffect(int id, Vector3 position, Vector3 forward, float scale = 1f)
|
| | | {
|
| | | SFXController _controller = Play(id, position, forward, scale);
|
| | |
|
| | | if (_controller != null)
|
| | | {
|
| | | _controller.gameObject.SetLayer(LayerUtility.BattleEffect, true);
|
| | | }
|
| | |
|
| | | return _controller;
|
| | | }
|
| | |
| | | |
| | | if (m_FoTransMit.ammoEffectId > 0) |
| | | { |
| | | SFXController _sfx = SFXPlayUtility.Instance.PlayBattleEffect(m_FoTransMit.ammoEffectId, _fight); |
| | | if (_sfx) |
| | | if (BattleEffectPlayRule.Instance.CanPlay(m_InitInfo.casterServerObjID)) |
| | | { |
| | | _sfx.duration = m_FoTransMit.eachLastTime; |
| | | FoTransmitController _controller = _sfx.AddMissingComponent<FoTransmitController>(); |
| | | _controller.start = _start; |
| | | _controller.end = _end; |
| | | _controller.transmit = _sfx; |
| | | _controller.enabled = true; |
| | | _sfx.m_OnFinished += OnSFXDisable; |
| | | SFXController _sfx = SFXPlayUtility.Instance.PlayBattleEffect(m_FoTransMit.ammoEffectId, _fight); |
| | | if (_sfx) |
| | | { |
| | | _sfx.duration = m_FoTransMit.eachLastTime; |
| | | FoTransmitController _controller = _sfx.AddMissingComponent<FoTransmitController>(); |
| | | _controller.start = _start; |
| | | _controller.end = _end; |
| | | _controller.transmit = _sfx; |
| | | _controller.enabled = true; |
| | | _sfx.m_OnFinished += OnSFXDisable; |
| | | |
| | | m_CacheAllEffect.Add(_sfx); |
| | | m_CacheAllEffect.Add(_sfx); |
| | | } |
| | | //Debug.LogFormat("播放特效: 开始: {0}, 结束: {1}", _start, _end); |
| | | } |
| | | |
| | | //Debug.LogFormat("播放特效: 开始: {0}, 结束: {1}", _start, _end); |
| | | } |
| | | |
| | | if (_target2 != null) |
| | |
| | | _xayShadow.transform.localScale = requester.transform.localScale; |
| | | _xayShadow.transform.position = requester.transform.position; |
| | | _xayShadow.transform.rotation = requester.transform.rotation; |
| | | _xayShadow.layer = LayerUtility.BattleEffect; |
| | | _xayShadow.layer = LayerUtility.BattleEffectLow; |
| | | |
| | | XRayShadowController _controller = _xayShadow.AddComponent<XRayShadowController>(); |
| | | _controller.duration = lastTime; |
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (!BattleEffectPlayRule.Instance.CanPlay(owner.ServerInstID))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | SFXController _controller = SFXPlayUtility.Instance.PlayBattleEffect(id, owner);
|
| | | if (_controller)
|
| | | {
|
| | |
| | | { |
| | | if (_player.SelectTarget != null) |
| | | { |
| | | m_StartHeadEffect = SFXPlayUtility.Instance.PlayBattleEffect(m_CacheSkill.skillInfo.soFile.effectOnTargetHead, _player.SelectTarget); |
| | | if (BattleEffectPlayRule.Instance.CanPlay(_player.ServerInstID)) |
| | | { |
| | | m_StartHeadEffect = SFXPlayUtility.Instance.PlayBattleEffect(m_CacheSkill.skillInfo.soFile.effectOnTargetHead, _player.SelectTarget); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | GActorFight _target = GAMgr.Instance.GetBySID(data.ObjID) as GActorFight;
|
| | |
|
| | | if (_target != null)
|
| | | if (!(_target is GA_Player) || BattleEffectPlayRule.Instance.CanPlay(data.ObjID))
|
| | | {
|
| | | if (m_SkillConfig.BuffEffectID > 0)
|
| | | if (_target != null)
|
| | | {
|
| | | if (m_Effect)
|
| | | if (m_SkillConfig.BuffEffectID > 0)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | }
|
| | |
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (h0605.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (!_target.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | m_Effect = SFXPlayUtility.Instance.PlayBattleEffect(m_SkillConfig.BuffEffectID, _target);
|
| | | if (m_Effect)
|
| | | {
|
| | | m_Effect.m_OnFinished += OnEffectOver;
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | }
|
| | |
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (h0605.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (!_target.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | m_Effect = SFXPlayUtility.Instance.PlayBattleEffect(m_SkillConfig.BuffEffectID, _target);
|
| | | if (m_Effect)
|
| | | {
|
| | | m_Effect.m_OnFinished += OnEffectOver;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class BattleEffectPlayRule : Singleton<BattleEffectPlayRule> |
| | | { |
| | | public List<uint> sortPlayerList = new List<uint>(); |
| | | |
| | | private int limit |
| | | { |
| | | get |
| | | { |
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High) |
| | | { |
| | | return 7; |
| | | } |
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium) |
| | | { |
| | | return 3; |
| | | } |
| | | else |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public float timeEscape; |
| | | |
| | | public void Update() |
| | | { |
| | | if (Time.realtimeSinceStartup - timeEscape > .5f) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | sortPlayerList.Sort((id1, id2) => |
| | | { |
| | | GActor _actor1 = GAMgr.Instance.GetBySID(id1); |
| | | GActor _actor2 = GAMgr.Instance.GetBySID(id2); |
| | | |
| | | float _dis1 = MathUtility.DistanceSqrtXZ(_hero.Pos, _actor1.Pos); |
| | | float _dis2 = MathUtility.DistanceSqrtXZ(_hero.Pos, _actor2.Pos); |
| | | |
| | | return _dis2 > _dis1 ? -1 : 1; |
| | | }); |
| | | |
| | | timeEscape = Time.realtimeSinceStartup; |
| | | } |
| | | } |
| | | |
| | | public bool CanPlay(uint sid) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 选中英雄必显示 |
| | | if (_hero.SelectTarget != null) |
| | | { |
| | | if (_hero.SelectTarget.ServerInstID == sid |
| | | || _hero.LockTarget.ServerInstID == sid) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | // 获取传入的玩家在排序后的队列中的索引 |
| | | int _index = sortPlayerList.IndexOf(sid); |
| | | |
| | | // 不存在可能是异常,不播放 |
| | | if (_index < 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 在限定的数量内,允许播放 |
| | | if (_index < limit) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 52c66c7311d7af341b7bdb32f3cd7096 |
| | | timeCreated: 1537445788 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public Dictionary<int, string> s_NpcID2BundleName = new Dictionary<int, string>();
|
| | | public Dictionary<int, string> s_NpcID2Assetname = new Dictionary<int, string>();
|
| | |
|
| | |
|
| | |
|
| | | public event UnityAction<uint> OnGActorRequest;
|
| | | public event UnityAction<uint> OnGActorServerDie;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | UpdateOffLinePlayer();
|
| | |
|
| | | BattleEffectPlayRule.Instance.Update();
|
| | | }
|
| | |
|
| | | public void DoLateUpdate()
|
| | |
| | | SetAnimatorSpeed(JobSetup.RushAnimatorSpeed * Constants.F_DELTA);
|
| | | m_LastRushTime = Time.time;
|
| | |
|
| | | if (m_RushEffect == null)
|
| | | if (this is GA_Hero || BattleEffectPlayRule.Instance.CanPlay(ServerInstID))
|
| | | {
|
| | | m_RushEffect = SFXPlayUtility.Instance.PlayBattleEffect(50401, this);
|
| | | m_RushEffect.duration = 0;
|
| | | if (m_RushEffect == null)
|
| | | {
|
| | | m_RushEffect = SFXPlayUtility.Instance.PlayBattleEffect(50401, this);
|
| | | m_RushEffect.duration = 0;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (GA_Hero.s_MapSwitching)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero.IsRun())
|
| | | if (PlayerDatas.Instance.hero != null
|
| | | && PlayerDatas.Instance.hero.IsRun())
|
| | | {
|
| | | PlayerDatas.Instance.hero.IdleImmediate();
|
| | | }
|
| | |
| | | public static readonly int BossShow = LayerMask.NameToLayer("BossShow"); |
| | | public static readonly int BossShowMask = 1 << BossShow; |
| | | |
| | | public static readonly int BattleEffect = LayerMask.NameToLayer("BattleEffect"); |
| | | public static readonly int BattleEffectMask = 1 << BattleEffect; |
| | | public static readonly int BattleEffectLow = LayerMask.NameToLayer("BattleEffectLow"); |
| | | public static readonly int BattleEffectLowMask = 1 << BattleEffectLow; |
| | | public static readonly int BattleEffectMid = LayerMask.NameToLayer("BattleEffectMid"); |
| | | public static readonly int BattleEffectMidMask = 1 << BattleEffectMid; |
| | | public static readonly int BattleEffectHigh = LayerMask.NameToLayer("BattleEffectHigh"); |
| | | public static readonly int BattleEffectHighMask = 1 << BattleEffectHigh; |
| | | |
| | | public static readonly int Hide = LayerMask.NameToLayer("Hide"); |
| | | public static readonly int HideMask = 1 << Hide; |