少年修仙传客户端代码仓库
client_Hale
2018-12-11 e3aa6cc5e079e4310fa8f39a5fb61762640d1d20
5224 游戏帧数优化: 宠物特效和坐骑特效加入按照游戏质量级屏蔽数量规则
12个文件已修改
273 ■■■■■ 已修改文件
Core/GameEngine/Model/Config/ModelResConfig.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/ModelResConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/BattleEffectPlayRule.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GAMgr.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_Pet.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActor.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorFight.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorNpcFight.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorNpcNoFight.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorPlayerBase.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/PartialModelResConfig.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GeneralConfig/GeneralDefine.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/ModelResConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Wednesday, November 28, 2018
//    [  Date ]:           Monday, December 10, 2018
//--------------------------------------------------------
using UnityEngine;
@@ -20,6 +20,7 @@
        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; } 
@@ -52,15 +53,17 @@
            
                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)
            {
Core/GameEngine/Model/Config/ModelResConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 290b3d02a826d6b4daabb2e80dfaa3ab
timeCreated: 1543388296
timeCreated: 1544430338
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Fight/GameActor/BattleEffectPlayRule.cs
@@ -82,6 +82,45 @@
        }
    }
    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()
Fight/GameActor/GAMgr.cs
@@ -118,6 +118,7 @@
                if (_player == null || !_player.ShowOrHide)
                {
                    _pet.ShowOrHideModel(false);
                    _pet.HideEffect();
                    //Debug.LogFormat("宠物: {0} 的拥有者: {1} 不可见, 这里隐藏.", _pet.ServerInstID, _parentID);
                    continue;
                }
@@ -133,6 +134,15 @@
                    _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();
                }
            }
        }
@@ -146,6 +156,7 @@
                if (_chkPlayer == null || !_chkPlayer.ShowOrHide)
                {
                    _player.SwitchGuard(0);
                    _player.HideHorseEffect();
                    //Debug.LogFormat("_list: {0} 的拥有者: {1} 不可见, 这里隐藏.", _chkPlayer.ServerInstID, _player.ServerInstID);
                    continue;
                }
@@ -159,6 +170,17 @@
                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);
                }
            }
@@ -1263,7 +1285,8 @@
        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;
        }
Fight/GameActor/GA_Pet.cs
@@ -1,4 +1,5 @@

using System.Collections.Generic;
using Snxxz.UI;
using UnityEngine;
@@ -31,11 +32,32 @@
        }
    }
    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;
@@ -64,9 +86,18 @@
        }
    }
    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() { }
Fight/GameActor/GActor.cs
@@ -1,4 +1,5 @@
using Snxxz.UI;
using System.Collections.Generic;
using Snxxz.UI;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
@@ -552,7 +553,18 @@
    #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;
Fight/GameActor/GActorFight.cs
@@ -88,6 +88,8 @@
    protected override void OnUnit()
    {
        HideEffect();
        m_StartedFlash = false;
        m_FlashLastTime = 0;
        SelectTarget = null;
@@ -128,6 +130,8 @@
        }
    }
    public override void ShowEffect() { }
    public abstract override void Destroy();
    /// <summary>
Fight/GameActor/GActorNpcFight.cs
@@ -192,6 +192,8 @@
    protected override void OnUnit()
    {
        HideEffect();
        StatusMgr.Instance.ReleaseActor(ServerInstID);
        if (!ShowOrHide)
@@ -577,7 +579,7 @@
    /// 显示或者隐藏表现层
    /// </summary>
    /// <param name="showOrHide">显示: true, 隐藏: false</param>
    public sealed override void ShowOrHideModel(bool showOrHide)
    public override void ShowOrHideModel(bool showOrHide)
    {
        if (ShowOrHide == showOrHide)
        {
Fight/GameActor/GActorNpcNoFight.cs
@@ -78,6 +78,8 @@
        InstanceResourcesLoader.AsyncLoadNpc(NpcConfig.NPCID, OnPrefabLoadFinished);
    }
    public override void ShowEffect() { }
    protected virtual void HandleNpcConfig(int npcID)
    {
        NpcConfig = Config.Instance.Get<NPCConfig>(npcID);
@@ -85,6 +87,8 @@
    protected override void OnUnit()
    {
        HideEffect();
        if (m_LoadDefaultRes)
        {
            GameObjectPoolManager.Instance.ReleaseDefaultFuncNPC(m_Model);
Fight/GameActor/GActorPlayerBase.cs
@@ -230,6 +230,8 @@
        GameObject _prefab = null;
        HideHorseEffect();
        if (m_HorseModel)
        {
            HorseConfig _horseConfig = Config.Instance.Get<HorseConfig>((int)HorseID);
@@ -1142,6 +1144,8 @@
        if (_newHorseID <= 0)
        {
            HideHorseEffect();
            if (MovingState != E_MovingState.Ride)
            {
                return;
@@ -1378,6 +1382,43 @@
        }
        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);
@@ -2250,7 +2291,7 @@
                        return 12600 + index;
                }
            }
            else if(this is GA_NpcFightSgzcZZ)
            else if (this is GA_NpcFightSgzcZZ)
            {
                switch (JobSetup.Job)
                {
Fight/GameActor/PartialModelResConfig.cs
@@ -5,7 +5,10 @@
{
    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()
        {
@@ -17,15 +20,76 @@
                {
                    _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;
        }
System/GeneralConfig/GeneralDefine.cs
@@ -155,6 +155,12 @@
    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; }
@@ -546,6 +552,16 @@
            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);