コード例 #1
0
ファイル: PackageProxy.cs プロジェクト: mengtest/RewriteFrame
 /// <summary>
 /// 同步道具的lv和exp属性
 /// </summary>
 /// <param name="uid"></param>
 /// <param name="lv"></param>
 /// <param name="exp"></param>
 public void ChangeItemAttr(ulong uid, int lv, int exp)
 {
     if (m_Items.TryGetValue(uid, out ItemContainer item))
     {
         switch (item)
         {
         case ItemWarShipVO val:
         {
             if (exp > 0)
             {
                 val.Exp = exp;
             }
             if (item.Lv > 0 && item.Lv != lv)
             {
                 MsgShipLevelUp msg = new MsgShipLevelUp();
                 msg.m_level = lv;
                 msg.m_Tid   = item.TID;
                 Facade.SendNotification(NotificationName.MSG_PLAYER_SHIP_LEVEL_UP, msg);
             }
         }
         break;
         }
         item.Lv = lv;
     }
 }
コード例 #2
0
    /// <summary>
    /// 初始化消息动画
    /// </summary>
    private void InitializeMessageAnimation()
    {
        switch (m_CurrentMessage.type)
        {
        case NotificationName.MSG_MISSION_ACCEPT:
        case NotificationName.MSG_MISSION_FAIL:
            break;

        case NotificationName.MSG_MISSION_COMMIT:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = TableUtil.GetLanguageString("mission_title_1005");
            }
        }
        break;

        case NotificationName.MSG_MISSION_STATE_CHANGE:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = TableUtil.GetLanguageString("mission_title_1015");
            }
        }
        break;

        case NotificationName.MSG_PLAYER_LEVEL_UP:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = m_CurrentMessage.argument != null ? "Lv." + m_CurrentMessage.argument.ToString() : string.Empty;
            }
        }
        break;

        case NotificationName.MSG_PLAYER_SHIP_LEVEL_UP:
        {
            MsgShipLevelUp msg       = (MsgShipLevelUp)m_CurrentMessage.argument;
            UIIconAndLabel shipLabel = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (shipLabel && shipLabel.Label)
            {
                shipLabel.Label.text = m_CurrentMessage.argument != null ? "Lv." + msg.m_level : string.Empty;
            }
            if (shipLabel && shipLabel.Icon)
            {
                UIUtil.SetIconImage(shipLabel.Icon, TableUtil.GetItemIconTid(msg.m_Tid));
            }
            if (shipLabel && shipLabel.Info)
            {
                string name = TableUtil.GetItemName(msg.m_Tid);
                shipLabel.Info.text = string.Format(TableUtil.GetLanguageString("hud_text_id_1036"), name);
            }
        }
        break;
        }
    }