| | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | sortPlayerList.Add(id); |
| | | SortList(); |
| | | |
| | | // 是否已经达到数量显示上限 |
| | | if (showPlayerList.Count < limit) |
| | | { |
| | | showPlayerList.Add(id); |
| | | } |
| | | } |
| | | |
| | | public void RemovePlayer(uint id) |
| | |
| | | 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 |
| | |
| | | }); |
| | | } |
| | | |
| | | public void Update() |
| | | { |
| | | if (Time.realtimeSinceStartup - timeEscape > .5f) |
| | | { |
| | | SortList(); |
| | | timeEscape = Time.realtimeSinceStartup; |
| | | } |
| | | } |
| | | public void Update() { } |
| | | |
| | | public int GetIndex(uint sid) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | if(!showPlayerList.Contains(sid)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 获取传入的玩家在排序后的队列中的索引 |
| | | int _index = sortPlayerList.IndexOf(sid); |
| | | |