Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | 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); |
| | | |
| | |
| | | }
|
| | |
|
| | | UpdateOffLinePlayer();
|
| | |
|
| | | BattleEffectPlayRule.Instance.Update();
|
| | | }
|
| | |
|
| | | public void DoLateUpdate()
|
| | |
| | | private void CheckHelpPointExchange()
|
| | | {
|
| | | int pushId = exchageModel.currentShopId;
|
| | | m_HelpPointExchangeNotify.gameObject.SetActive(pushId != 0);
|
| | | if (pushId != 0)
|
| | | StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(pushId);
|
| | | if (pushId != 0 && storeConfig != null)
|
| | | {
|
| | | m_HelpPointExchangeNotify.gameObject.SetActive(true);
|
| | | m_HelpPointExchangeNotify.SetDisplay();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_HelpPointExchangeNotify.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckRealmBetterEquip()
|
| | |
| | | case FlashRushToBuyModel.FlashRushToBuySate.NoOpen:
|
| | | break;
|
| | | case FlashRushToBuyModel.FlashRushToBuySate.InAdvance:
|
| | |
|
| | | int saleDay = operation.startDate.day + saleShop.dayIndex;
|
| | | int offsetDay = saleDay - TimeUtility.ServerNow.Day;
|
| | | var operationDate = operation.startDate.AddDays(saleShop.dayIndex);
|
| | | DateTime openTime = new DateTime(operationDate.year,operationDate.month,operationDate.day);
|
| | | int offsetDay = Mathf.CeilToInt((float)(openTime - TimeUtility.ServerNow).TotalDays);
|
| | | if(offsetDay > 1)
|
| | | {
|
| | | string saleDate = StringUtility.Contact(operation.startDate.month, Language.Get("Month"),saleDay,Language.Get("Day"));
|
| | | string saleDate = StringUtility.Contact(operationDate.month, Language.Get("Month"), operationDate.day,Language.Get("Day"));
|
| | | timeText.text = saleDate;
|
| | | }
|
| | | else if(offsetDay == 1)
|
| | |
| | |
|
| | | int seconds = 0;
|
| | | OperationTime operationTime = operation.times[timeIndex];
|
| | | var date = operation.startDate;
|
| | | int buyState = operation.GetBuyTimeState(TimeUtility.ServerNow, dayIndex, timeIndex, out seconds);
|
| | | var operationDate = operation.startDate.AddDays(dayIndex);
|
| | | switch (buyState)
|
| | | {
|
| | | case -1:
|
| | | string timeStr = "";
|
| | | if(seconds > 7200)
|
| | | {
|
| | | timeStr = operation.ToDisplayBuyTime(date.month, dayIndex + date.day, operationTime.startHour, operationTime.startMinute);
|
| | | timeStr = operation.ToDisplayBuyTime(operationDate.month, operationDate.day, operationTime.startHour, operationTime.startMinute);
|
| | | remainText.text = Language.Get("FlashRushToBuy106", timeStr);
|
| | | }
|
| | | else
|
| | |
| | | public int GetBuyTimeState(DateTime time,int dayIndex,int timeIndex,out int seconds)
|
| | | {
|
| | | seconds = 0;
|
| | | int day = startDate.day + dayIndex;
|
| | | var operationDate = startDate.AddDays(dayIndex);
|
| | | OperationTime operationTime = times[timeIndex];
|
| | | var startTime = new DateTime(startDate.year, startDate.month,day, operationTime.startHour, operationTime.startMinute,0);
|
| | | var endTime = new DateTime(startDate.year, startDate.month,day, operationTime.endHour, operationTime.endMinute, 0);
|
| | | var startTime = new DateTime(operationDate.year, operationDate.month, operationDate.day, operationTime.startHour, operationTime.startMinute,0);
|
| | | var endTime = new DateTime(operationDate.year, operationDate.month, operationDate.day, operationTime.endHour, operationTime.endMinute, 0);
|
| | | int advanceSec = Mathf.CeilToInt((float)(startTime - time).TotalSeconds);
|
| | | int endSec = Mathf.CeilToInt((float)(endTime - time).TotalSeconds);
|
| | | if (advanceSec > 0)
|