5224 游戏帧数优化: 宠物特效和坐骑特效加入按照游戏质量级屏蔽数量规则
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, November 28, 2018
|
| | | // [ Date ]: Monday, December 10, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | |
| | | public string Material_Fight_Suit { get ; private set; }
|
| | | public string Material_UI_Normal { get ; private set; }
|
| | | public string Material_UI_Suit { get ; private set; }
|
| | | public string boneNameList { get ; private set; } |
| | | public string EffFileName { get ; private set; }
|
| | | public Vector3 UIOffset { get ; private set; }
|
| | | public Vector3 UIRotation { get ; private set; }
|
| | |
| | |
|
| | | Material_UI_Suit = rawContents[8].Trim();
|
| | |
|
| | | EffFileName = rawContents[9].Trim();
|
| | | boneNameList = rawContents[9].Trim();
|
| | |
|
| | | UIOffset=rawContents[10].Vector3Parse();
|
| | | EffFileName = rawContents[10].Trim();
|
| | |
|
| | | UIRotation=rawContents[11].Vector3Parse();
|
| | | UIOffset=rawContents[11].Vector3Parse();
|
| | |
|
| | | UIScale=rawContents[12].Vector3Parse();
|
| | | UIRotation=rawContents[12].Vector3Parse();
|
| | |
|
| | | Scale=rawContents[13].Vector3Parse();
|
| | | UIScale=rawContents[13].Vector3Parse();
|
| | | |
| | | Scale=rawContents[14].Vector3Parse();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 290b3d02a826d6b4daabb2e80dfaa3ab |
| | | timeCreated: 1543388296 |
| | | timeCreated: 1544430338 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | } |
| | | } |
| | | |
| | | public int petEffectLimit |
| | | { |
| | | get |
| | | { |
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High) |
| | | { |
| | | return GeneralDefine.highQualityPetEffectCount; |
| | | } |
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium) |
| | | { |
| | | return GeneralDefine.medQualityPetEffectCount; |
| | | } |
| | | else |
| | | { |
| | | return GeneralDefine.lowQualityPetEffectCount; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int horseEffectLimit |
| | | { |
| | | get |
| | | { |
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High) |
| | | { |
| | | return GeneralDefine.highQualityHorseEffectCount; |
| | | } |
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium) |
| | | { |
| | | return GeneralDefine.medQualityHorseEffectCount; |
| | | } |
| | | else |
| | | { |
| | | return GeneralDefine.lowQualityHorseEffectCount; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public float timeEscape; |
| | | |
| | | private void SortList() |
| | |
| | | if (_player == null || !_player.ShowOrHide)
|
| | | {
|
| | | _pet.ShowOrHideModel(false);
|
| | | _pet.HideEffect();
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 不可见, 这里隐藏.", _pet.ServerInstID, _parentID);
|
| | | continue;
|
| | | }
|
| | |
| | | _pet.ShowOrHideModel(false);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | |
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.petEffectLimit)
|
| | | {
|
| | | _pet.ShowEffect();
|
| | | }
|
| | | else
|
| | | {
|
| | | _pet.HideEffect();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (_chkPlayer == null || !_chkPlayer.ShowOrHide)
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | _player.HideHorseEffect();
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 不可见, 这里隐藏.", _chkPlayer.ServerInstID, _player.ServerInstID);
|
| | | continue;
|
| | | }
|
| | |
| | | else
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | |
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.horseEffectLimit)
|
| | | {
|
| | | _player.ShowHorseEffect();
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _player.HideHorseEffect();
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | }
|
| | |
| | | else if (_type == typeof(GA_NpcFightZZPlayer))
|
| | | {
|
| | | return (byte)E_ActorClassType.PlayerZZ;
|
| | | }else if(_type == typeof(GA_NpcFightSgzcZZ))
|
| | | }
|
| | | else if (_type == typeof(GA_NpcFightSgzcZZ))
|
| | | {
|
| | | return (byte)E_ActorClassType.PlayerSgzcRobot;
|
| | | }
|
| | |
| | |
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | using UnityEngine;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public sealed override void ShowEffect()
|
| | | {
|
| | | HideEffect();
|
| | |
|
| | | string _modelName = NpcConfig.MODE;
|
| | | var _config = TableConfig.ModelResConfig.GetPetConfig(_modelName);
|
| | | if (_config != null)
|
| | | {
|
| | | var _dict = TableConfig.ModelResConfig.GetEffectDict(_modelName);
|
| | | if (_dict != null)
|
| | | {
|
| | | foreach (var _bone in _dict.Keys)
|
| | | {
|
| | | var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_Model.transform.GetChildTransformDeeply(_bone));
|
| | | m_EffectList.Add(_ctrl);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected sealed override void OnMainModelLoaded()
|
| | | {
|
| | | base.OnMainModelLoaded();
|
| | |
|
| | | uint _parentSID = ServerInstID / 10;
|
| | |
|
| | | if (_parentSID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | GA_Player _player = GAMgr.Instance.GetBySID(_parentSID) as GA_Player;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | protected sealed override void OnUnit()
|
| | | public sealed override void ShowOrHideModel(bool showOrHide)
|
| | | {
|
| | | base.OnUnit();
|
| | | base.ShowOrHideModel(showOrHide);
|
| | |
|
| | | if (showOrHide)
|
| | | {
|
| | | ShowEffect();
|
| | | }
|
| | | else
|
| | | {
|
| | | HideEffect();
|
| | | }
|
| | | }
|
| | |
|
| | | public sealed override void RequestLifeBar() { }
|
| | |
| | | using Snxxz.UI;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | using UnityEngine;
|
| | | using UnityEngine.AI;
|
| | | using UnityEngine.Events;
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | protected List<SFXController> m_EffectList = new List<SFXController>();
|
| | |
|
| | | public abstract void ShowOrHideModel(bool showOrHide);
|
| | | public abstract void ShowEffect();
|
| | | public virtual void HideEffect()
|
| | | {
|
| | | foreach (var _ctrl in m_EffectList)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(_ctrl);
|
| | | }
|
| | | m_EffectList.Clear();
|
| | | }
|
| | |
|
| | | protected Vector3 MP_Name_Pos;
|
| | |
|
| | |
| | |
|
| | | protected override void OnUnit()
|
| | | {
|
| | | HideEffect();
|
| | |
|
| | | m_StartedFlash = false;
|
| | | m_FlashLastTime = 0;
|
| | | SelectTarget = null;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public override void ShowEffect() { }
|
| | |
|
| | | public abstract override void Destroy();
|
| | |
|
| | | /// <summary>
|
| | |
| | |
|
| | | protected override void OnUnit()
|
| | | {
|
| | | HideEffect();
|
| | |
|
| | | StatusMgr.Instance.ReleaseActor(ServerInstID);
|
| | |
|
| | | if (!ShowOrHide)
|
| | |
| | | /// 显示或者隐藏表现层
|
| | | /// </summary>
|
| | | /// <param name="showOrHide">显示: true, 隐藏: false</param>
|
| | | public sealed override void ShowOrHideModel(bool showOrHide)
|
| | | public override void ShowOrHideModel(bool showOrHide)
|
| | | {
|
| | | if (ShowOrHide == showOrHide)
|
| | | {
|
| | |
| | | InstanceResourcesLoader.AsyncLoadNpc(NpcConfig.NPCID, OnPrefabLoadFinished);
|
| | | }
|
| | |
|
| | | public override void ShowEffect() { }
|
| | |
|
| | | protected virtual void HandleNpcConfig(int npcID)
|
| | | {
|
| | | NpcConfig = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
| | |
|
| | | protected override void OnUnit()
|
| | | {
|
| | | HideEffect();
|
| | |
|
| | | if (m_LoadDefaultRes)
|
| | | {
|
| | | GameObjectPoolManager.Instance.ReleaseDefaultFuncNPC(m_Model);
|
| | |
| | |
|
| | | GameObject _prefab = null;
|
| | |
|
| | | HideHorseEffect();
|
| | |
|
| | | if (m_HorseModel)
|
| | | {
|
| | | HorseConfig _horseConfig = Config.Instance.Get<HorseConfig>((int)HorseID);
|
| | |
| | |
|
| | | if (_newHorseID <= 0)
|
| | | {
|
| | | HideHorseEffect();
|
| | |
|
| | | if (MovingState != E_MovingState.Ride)
|
| | | {
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | HorseID = _newHorseID;
|
| | |
|
| | | if (ShowOrHide)
|
| | | {
|
| | | ShowHorseEffect();
|
| | | }
|
| | | }
|
| | |
|
| | | private List<SFXController> m_HorseEffectList = new List<SFXController>();
|
| | |
|
| | | public void HideHorseEffect()
|
| | | {
|
| | | foreach (var _ctrl in m_HorseEffectList)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(_ctrl);
|
| | | }
|
| | | m_HorseEffectList.Clear();
|
| | | }
|
| | |
|
| | | public void ShowHorseEffect()
|
| | | {
|
| | | HideHorseEffect();
|
| | | var _horseConfig = Config.Instance.Get<HorseConfig>((int)HorseID);
|
| | | var _config = Config.Instance.Get<ModelResConfig>(_horseConfig.Model);
|
| | | if (_config == null)
|
| | | {
|
| | | Debug.LogError("找不到配置: " + HorseID);
|
| | | return;
|
| | | }
|
| | | var _dict = ModelResConfig.GetEffectDict(_config.ResourcesName);
|
| | | if (_dict != null)
|
| | | {
|
| | | foreach (var _bone in _dict.Keys)
|
| | | {
|
| | | var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_HorseModel.transform.GetChildTransformDeeply(_bone));
|
| | | m_HorseEffectList.Add(_ctrl);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public abstract void ChangeEquip(EquipInfo equipInfo);
|
| | |
| | | return 12600 + index;
|
| | | }
|
| | | }
|
| | | else if(this is GA_NpcFightSgzcZZ)
|
| | | else if (this is GA_NpcFightSgzcZZ)
|
| | | {
|
| | | switch (JobSetup.Job)
|
| | | {
|
| | |
| | | { |
| | | public partial class ModelResConfig : ConfigBase, IConfigPostProcess |
| | | { |
| | | private static readonly Dictionary<string, ModelResConfig> dict = new Dictionary<string, ModelResConfig>(); |
| | | private static readonly Dictionary<string, ModelResConfig> suitDict = new Dictionary<string, ModelResConfig>(); |
| | | private static readonly Dictionary<string, ModelResConfig> petDict = new Dictionary<string, ModelResConfig>(); |
| | | private static readonly Dictionary<string, ModelResConfig> horseDict = new Dictionary<string, ModelResConfig>(); |
| | | private static readonly Dictionary<string, Dictionary<string, int>> effectDict = new Dictionary<string, Dictionary<string, int>>(); |
| | | |
| | | public void OnConfigParseCompleted() |
| | | { |
| | |
| | | { |
| | | _name = _name.Substring(_index + 1); |
| | | } |
| | | dict[_name] = this; |
| | | suitDict[_name] = this; |
| | | } |
| | | else if (Type == (int)E_ModelResType.Horse) |
| | | { |
| | | horseDict[ResourcesName] = this; |
| | | } |
| | | else if (Type == (int)E_ModelResType.Pet) |
| | | { |
| | | petDict[ResourcesName] = this; |
| | | } |
| | | |
| | | if (Type == (int)E_ModelResType.Horse |
| | | || Type == (int)E_ModelResType.Pet) |
| | | { |
| | | if (!string.IsNullOrEmpty(boneNameList)) |
| | | { |
| | | var _bones = boneNameList.Split('|'); |
| | | var _effects = EffFileName.Split('|'); |
| | | |
| | | if (_bones.Length != _effects.Length) |
| | | { |
| | | Debug.LogWarningFormat("{0} 绑定骨骼的数量和特效的数量无法对应 {1} != {2}", ID, _bones.Length, _effects.Length); |
| | | } |
| | | |
| | | var _dict = new Dictionary<string, int>(); |
| | | |
| | | for (int i = 0; i < _bones.Length && i < _effects.Length; ++i) |
| | | { |
| | | _dict[_bones[i]] = int.Parse(_effects[i]); |
| | | |
| | | // Debug.LogFormat("设置特效配置: {0} => {1}", _bones[i], _dict[_bones[i]]); |
| | | } |
| | | |
| | | effectDict[ResourcesName] = _dict; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static Dictionary<string, int> GetEffectDict(string name) |
| | | { |
| | | if (effectDict.ContainsKey(name)) |
| | | { |
| | | return effectDict[name]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static ModelResConfig GetClothesConfig(string name) |
| | | { |
| | | if(dict.ContainsKey(name)) |
| | | if (suitDict.ContainsKey(name)) |
| | | { |
| | | return dict[name]; |
| | | return suitDict[name]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static ModelResConfig GetHorseConfig(string name) |
| | | { |
| | | if (horseDict.ContainsKey(name)) |
| | | { |
| | | return horseDict[name]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static ModelResConfig GetPetConfig(string name) |
| | | { |
| | | if (petDict.ContainsKey(name)) |
| | | { |
| | | return petDict[name]; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | public static int lowQualityGuardCount { get; private set; } |
| | | public static int medQualityGuardCount { get; private set; } |
| | | public static int highQualityGuardCount { get; private set; } |
| | | public static int lowQualityPetEffectCount { get; private set; } |
| | | public static int medQualityPetEffectCount { get; private set; } |
| | | public static int highQualityPetEffectCount { get; private set; } |
| | | public static int lowQualityHorseEffectCount { get; private set; } |
| | | public static int medQualityHorseEffectCount { get; private set; } |
| | | public static int highQualityHorseEffectCount { get; private set; } |
| | | |
| | | public static int fairyLandBuffCondition { get; private set; } |
| | | public static int fairyLandBuffId { get; private set; } |
| | |
| | | lowQualityGuardCount = int.Parse(func.Numerical1); |
| | | medQualityGuardCount = int.Parse(func.Numerical2); |
| | | highQualityGuardCount = int.Parse(func.Numerical3); |
| | | |
| | | func = Config.Instance.Get<FuncConfigConfig>("QualityPetEffectCount"); |
| | | lowQualityPetEffectCount = int.Parse(func.Numerical1); |
| | | medQualityPetEffectCount = int.Parse(func.Numerical2); |
| | | highQualityPetEffectCount = int.Parse(func.Numerical3); |
| | | |
| | | func = Config.Instance.Get<FuncConfigConfig>("QualityHorseEffectCount"); |
| | | lowQualityHorseEffectCount = int.Parse(func.Numerical1); |
| | | medQualityHorseEffectCount = int.Parse(func.Numerical2); |
| | | highQualityHorseEffectCount = int.Parse(func.Numerical3); |
| | | |
| | | fairyLandBuffCondition = GetInt("XjmjAddHarm", 1); |
| | | fairyLandBuffId = GetInt("XjmjAddHarm", 2); |