Пример #1
0
 public void OnUpdatePanel(short state, OffLineLoginPush down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         this.dataList = down;
         if (OffHookUI.Instance != null && OffHookUI.Instance.get_gameObject().get_activeSelf())
         {
             OffHookUI.Instance.RefreshUI();
         }
     }
 }
Пример #2
0
    public void RefreshUI()
    {
        OffLineLoginPush offHookData = OffHookManager.Instance.GetOffHookData();

        this.SwitchMode(OffHookUI.Mode.BeginRegion);
        OffHookManager.Instance.SendPanelReq();
        if (offHookData != null)
        {
            string time = TimeConverter.GetTime(offHookData.hasTime, TimeFormat.DHHMM_Chinese);
            this.textOffTime.set_text(string.Format(GameDataUtils.GetChineseContent(330024, false), time));
            this.textLeftTimeValue.set_text(time);
            this.textLvValue.set_text(string.Format(GameDataUtils.GetChineseContent(330025, false), EntityWorld.Instance.EntSelf.Lv));
            string time2 = TimeConverter.GetTime(offHookData.offTime, TimeFormat.DHHMM_Chinese);
            this.textOffTimeValue.set_text(time2);
            this.textGetExpValue.set_text(string.Format(GameDataUtils.GetChineseContent(330026, false), AttrUtility.GetExpValueStr(offHookData.addExp)));
            this.textLvUpValue1.set_text(string.Format(GameDataUtils.GetChineseContent(330025, false), offHookData.roleLv));
            this.textLvUpValue2.set_text(string.Format(GameDataUtils.GetChineseContent(330025, false), EntityWorld.Instance.EntSelf.Lv));
        }
    }
Пример #3
0
    public void OnOffLineRes(short state, OffLineRes down = null)
    {
        if (state != 0)
        {
            if (state == 206)
            {
                Items items = DataReader <Items> .Get(down.itemId);

                if (items != null)
                {
                    UIManagerControl.Instance.ShowToastText(string.Format(GameDataUtils.GetChineseContent(509004, false), items.minLv));
                }
            }
            else
            {
                StateManager.Instance.StateShow(state, 0);
            }
            return;
        }
        if (down != null)
        {
            if (this.dataList != null)
            {
                this.dataList.hasTime = down.hasTime;
            }
            else
            {
                this.dataList         = new OffLineLoginPush();
                this.dataList.hasTime = down.hasTime;
            }
            int getTime = down.GetTime;
            if (getTime % 60 == 0)
            {
                UIManagerControl.Instance.ShowToastText(string.Format(GameDataUtils.GetChineseContent(330035, false), getTime / 60));
            }
            else
            {
                UIManagerControl.Instance.ShowToastText(string.Format(GameDataUtils.GetChineseContent(330035, false), Math.Round(getTime / 60m, 1).ToString("F1")));
            }
        }
    }