少年修仙传客户端代码仓库
client_Hale
2018-12-21 2054154a56c5fdf2319a6005b8c08114f56ae2db
5482  【1.4.0】游戏帧数优化(二)
3个文件已修改
111 ■■■■■ 已修改文件
Fight/GameActor/GAMgr.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_Player.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorPlayerBase.cs 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GAMgr.cs
@@ -176,11 +176,17 @@
                if (_index != -1 && _index < BattleEffectPlayRule.Instance.horseEffectLimit)
                {
                    _player.ShowHorseEffect();
                    _player.ShowWeaponEffect();
                    _player.ShowSecondaryEffect();
                    _player.ShowGodWeaponEffect();
                    //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
                }
                else
                {
                    _player.HideHorseEffect();
                    _player.HideWeaponEffect();
                    _player.HideSecondaryEffect();
                    _player.HideGodWeaponEffect();
                    //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
                }
            }
Fight/GameActor/GA_Player.cs
@@ -465,6 +465,13 @@
        }
    }
    public override void ShowGodWeaponEffect()
    {
        SwitchGodWeapon(1, (int)m_H0434.ExAttr15);
        SwitchGodWeapon(2, (int)m_H0434.ExAttr16);
        SwitchGodWeapon(4, (int)m_H0434.ExAttr18);
    }
    public sealed override void RequestName()
    {
        ReleaseName();
Fight/GameActor/GActorPlayerBase.cs
@@ -230,6 +230,8 @@
        GameObject _prefab = null;
        HideWeaponEffect();
        HideSecondaryEffect();
        HideHorseEffect();
        if (m_HorseModel)
@@ -551,7 +553,7 @@
                    return;
                }
            }
            m_WeaponModel = null;
        }
@@ -597,6 +599,8 @@
        MP_Weapon = m_WeaponModel.transform;
        RequestShadow();
        ShowWeaponEffect();
    }
    public void SwitchSecondary(uint itemID)
@@ -704,6 +708,8 @@
        OnPutonSecondary(SecondaryID, m_SecondaryModel);
        RequestShadow();
        ShowSecondaryEffect();
    }
    public void SwitchWing(uint itemID)
@@ -1389,6 +1395,26 @@
    }
    private List<SFXController> m_HorseEffectList = new List<SFXController>();
    private List<SFXController> m_WeaponEffectList = new List<SFXController>();
    private List<SFXController> m_SecondaryEffectList = new List<SFXController>();
    public void HideSecondaryEffect()
    {
        foreach (var _ctrl in m_SecondaryEffectList)
        {
            SFXPlayUtility.Instance.Release(_ctrl);
        }
        m_SecondaryEffectList.Clear();
    }
    public void HideWeaponEffect()
    {
        foreach (var _ctrl in m_WeaponEffectList)
        {
            SFXPlayUtility.Instance.Release(_ctrl);
        }
        m_WeaponEffectList.Clear();
    }
    public void HideHorseEffect()
    {
@@ -1399,10 +1425,69 @@
        m_HorseEffectList.Clear();
    }
    public void ShowSecondaryEffect()
    {
        HideSecondaryEffect();
        if (SecondaryID <= 0)
        {
            return;
        }
        var _itemConfig = Config.Instance.Get<ItemConfig>((int)SecondaryID);
        if (_itemConfig != null)
        {
            return;
        }
        var _config = Config.Instance.Get<ModelResConfig>(_itemConfig.ChangeOrd);
        if (_config == null)
        {
            Debug.LogError("找不到配置ModelResConfig: " + _itemConfig.ChangeOrd);
            return;
        }
        var _dict = ModelResConfig.GetEffectDict(_config.ResourcesName);
        if (_dict != null)
        {
            foreach (var _bone in _dict.Keys)
            {
                var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_SecondaryModel.transform.GetChildTransformDeeply(_bone));
                m_SecondaryEffectList.Add(_ctrl);
            }
        }
    }
    public void ShowWeaponEffect()
    {
        HideWeaponEffect();
        if (WeaponItemID <= 0)
        {
            return;
        }
        var _itemConfig = Config.Instance.Get<ItemConfig>((int)WeaponItemID);
        if (_itemConfig != null)
        {
            return;
        }
        var _config = Config.Instance.Get<ModelResConfig>(_itemConfig.ChangeOrd);
        if (_config == null)
        {
            Debug.LogError("找不到配置ModelResConfig: " + _itemConfig.ChangeOrd);
            return;
        }
        var _dict = ModelResConfig.GetEffectDict(_config.ResourcesName);
        if (_dict != null)
        {
            foreach (var _bone in _dict.Keys)
            {
                var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_WeaponModel.transform.GetChildTransformDeeply(_bone));
                m_WeaponEffectList.Add(_ctrl);
            }
        }
    }
    public void ShowHorseEffect()
    {
        HideHorseEffect();
        if(HorseID <= 0)
        if (HorseID <= 0)
        {
            return;
        }
@@ -2447,6 +2532,15 @@
    private Dictionary<int, SFXController> m_GodWeaponEffectDict = new Dictionary<int, SFXController>();
    public virtual void ShowGodWeaponEffect() { }
    public void HideGodWeaponEffect()
    {
        SwitchGodWeapon(1,0);
        SwitchGodWeapon(2,0);
        SwitchGodWeapon(4,0);
    }
    public void SwitchGodWeapon(int type, int level)
    {
        bool _showOrHide = true;