Example #1
0
 public void OnGetRedPacketRes(short state, GetRedPacketRes down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         if (down.Status)
         {
             this.PanelData = down;
             UIManagerControl.Instance.OpenUI("RedBagUI", UINodesManager.NormalUIRoot, false, UIType.NonPush);
         }
         else
         {
             UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513247, false));
         }
         if (this.delayId != 0u)
         {
             TimerHeap.DelTimer(this.delayId);
         }
         this.isCantnotGetInfo = false;
         this.delayId          = TimerHeap.AddTimer(6000u, 0, delegate
         {
             this.isCantnotGetInfo = true;
         });
     }
 }
Example #2
0
    private void ShowInfo()
    {
        GetRedPacketRes panelData = RedBagManager.Instance.GetPanelData();

        if (panelData != null)
        {
            GetRedPacketRes.RedPacketType type = panelData.Type;
            int           taskId        = panelData.taskId;
            HongBaoShiJie hongBaoShiJie = DataReader <HongBaoShiJie> .Get(taskId);

            if (hongBaoShiJie == null)
            {
                return;
            }
            string chineseContent = GameDataUtils.GetChineseContent(hongBaoShiJie.Chinese, false);
            string text           = string.Empty;
            if (type == GetRedPacketRes.RedPacketType.KillBoss)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0), panelData.parameter.get_Item(1), panelData.parameter.get_Item(2));
            }
            else if (type == GetRedPacketRes.RedPacketType.Recharges)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0), panelData.parameter.get_Item(1));
            }
            else if (type == GetRedPacketRes.RedPacketType.VipLv)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0), panelData.parameter.get_Item(1));
            }
            else if (type == GetRedPacketRes.RedPacketType.TotalVipLv)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0), panelData.parameter.get_Item(1));
            }
            else if (type == GetRedPacketRes.RedPacketType.TotalRechargeTimes)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0));
            }
            else if (type == GetRedPacketRes.RedPacketType.TotalTwistedEggTimes)
            {
                text = string.Format(chineseContent, panelData.parameter.get_Item(0));
            }
            this.m_textInfoStr.set_text(text);
        }
    }