少年修仙传客户端代码仓库
client_Hale
2018-12-14 91d7da716cbc927b04a88ffcdfbb7c55554173a9
5448 【1.3.100】【前端】修改玩家显隐规则
2个文件已修改
42 ■■■■ 已修改文件
Fight/GameActor/BattleEffectPlayRule.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GAMgr.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/BattleEffectPlayRule.cs
@@ -5,6 +5,7 @@
public class BattleEffectPlayRule : Singleton<BattleEffectPlayRule>
{
    public readonly List<uint> sortPlayerList = new List<uint>();
    public readonly List<uint> showPlayerList = new List<uint>();
    public void AddPlayer(uint id)
    {
@@ -14,6 +15,12 @@
        }
        sortPlayerList.Add(id);
        SortList();
        // 是否已经达到数量显示上限
        if (showPlayerList.Count < limit)
        {
            showPlayerList.Add(id);
        }
    }
    public void RemovePlayer(uint id)
@@ -23,6 +30,25 @@
            sortPlayerList.Remove(id);
        }
        SortList();
        if(showPlayerList.Contains(id))
        {
            showPlayerList.Remove(id);
            for(int i = 0;i < sortPlayerList.Count;++i)
            {
                if(showPlayerList.Contains(sortPlayerList[i]))
                {
                    continue;
                }
                showPlayerList.Add(sortPlayerList[i]);
                break;
            }
            GAMgr.Instance.OnPlayerSyncCountChange();
        }
    }
    private int limit
@@ -153,14 +179,7 @@
                    });
    }
    public void Update()
    {
        if (Time.realtimeSinceStartup - timeEscape > .5f)
        {
            SortList();
            timeEscape = Time.realtimeSinceStartup;
        }
    }
    public void Update() { }
    public int GetIndex(uint sid)
    {
@@ -197,6 +216,11 @@
            }
        }
        if(!showPlayerList.Contains(sid))
        {
            return false;
        }
        // 获取传入的玩家在排序后的队列中的索引
        int _index = sortPlayerList.IndexOf(sid);
Fight/GameActor/GAMgr.cs
@@ -1024,8 +1024,6 @@
        }
        UpdateOffLinePlayer();
        BattleEffectPlayRule.Instance.Update();
    }
    public void DoLateUpdate()