Пример #1
0
    SysMsgPushParam ParseBtnSpite(TransmitAndInviteType type)
    {
        SysMsgPushParam data = null;

        if (sysMsgParamDic.ContainsKey(type))
        {
            data = sysMsgParamDic[type];
        }
        else
        {
            data = new SysMsgPushParam();
            string stringKeys = GameTableManager.Instance.GetGlobalConfig <string>(CONST_TRANSANDINVITE_ICON, type.ToString());
            if (stringKeys != null)
            {
                string[] args = stringKeys.Split('|');
                if (args.Length != 2 || string.IsNullOrEmpty(args[0]))
                {
                    Engine.Utility.Log.Error("全局配置表中的货币图标参数无法解析");
                }
                else
                {
                    data.m_type    = type;
                    data.iconName  = args[0];
                    data.titleName = args[1];
                }
            }
            sysMsgParamDic.Add(type, data);
        }

        return(data);
    }
Пример #2
0
 public void SetTransmitUI(PushMsg msg)
 {
     m_pushMsgType     = msg.msgType;
     m_pushMsgSenderID = msg.senderId;
     if (m_lableNum != null)
     {
         //这个地方num肯定为0
         int num = DataManager.Manager <FunctionPushManager>().GetMsgNum(m_pushMsgType);
         if (num > 0)
         {
             m_lableNum.text = num.ToString();
         }
         else
         {
             m_lableNum.text = "";
         }
     }
     m_pushMsg              = msg;
     m_l_leftSeconds        = msg.cd - (UnityEngine.Time.realtimeSinceStartup - msg.sendTime);
     m_l_pushCD             = msg.cd;
     CurPushMsgTypeIsInvite = false;
     if (m_spriteIcon != null)
     {
         SysMsgPushParam param = null;
         if (m_pushMsgType == PushMsg.MsgType.TeamTransmit)
         {
             param = ParseBtnSpite(TransmitAndInviteType.TeamTransmit);
         }
         else if (m_pushMsgType == PushMsg.MsgType.ClanTransmit)
         {
             param = ParseBtnSpite(TransmitAndInviteType.ClanTransmit);
         }
         else if (m_pushMsgType == PushMsg.MsgType.CoupleTransmit)
         {
             param = ParseBtnSpite(TransmitAndInviteType.CoupleTransmit);
         }
         else if (m_pushMsgType == PushMsg.MsgType.CityWarTeam)
         {
             param = ParseBtnSpite(TransmitAndInviteType.CityWarTeamTransmit);
         }
         else if (m_pushMsgType == PushMsg.MsgType.CityWarClan)
         {
             param = ParseBtnSpite(TransmitAndInviteType.CityWarClanTransmit);
         }
         if (param != null)
         {
             m_spriteIcon.spriteName  = param.iconName;
             m_spriteTitle.spriteName = param.titleName;
         }
     }
 }
Пример #3
0
    public void SetSysMsgUI(PushMsg.MsgType msgType)
    {
        m_pushMsgType = msgType;

        if (m_lableNum != null)
        {
            int num = DataManager.Manager <FunctionPushManager>().GetMsgNum(m_pushMsgType);
            if (num > 0)
            {
                m_lableNum.text = num.ToString();
            }
            else
            {
                m_lableNum.text = "";
            }
        }
        PushMsg msg = DataManager.Manager <FunctionPushManager>().GetPushMsg(m_pushMsgType);

        if (msg == null)
        {
            Engine.Utility.Log.Error("pushmsg == null");
            return;
        }
        m_pushMsg = msg;

        m_l_leftSeconds        = msg.cd - (UnityEngine.Time.realtimeSinceStartup - msg.sendTime);
        m_l_pushCD             = msg.cd;
        CurPushMsgTypeIsInvite = true;
        if (m_l_leftSeconds >= SHOWCDLIMIT)
        {
            ShowCDUI(false);
        }
        else
        {
            ShowCDUI(true);
        }

        if (m_spriteSlider != null)
        {
            m_spriteSlider.fillAmount = msg.leftTime / msg.cd;
        }
        if (m_labelTime != null)
        {
            m_labelTime.text = ((uint)msg.leftTime + 1).ToString();
        }

        if (m_spriteIcon != null)
        {
            SysMsgPushParam param = null;
            if (msg.msgType == PushMsg.MsgType.TeamLeaderInvite)
            {
                param = ParseBtnSpite(TransmitAndInviteType.TeamInvite);
            }
            else if (msg.msgType == PushMsg.MsgType.TeamMemberInvite)
            {
                param = ParseBtnSpite(TransmitAndInviteType.TeamMemberInvite);
            }
            else if (msg.msgType == PushMsg.MsgType.Arena)
            {
                param = ParseBtnSpite(TransmitAndInviteType.ArenaInvite);
            }
            else if (msg.msgType == PushMsg.MsgType.Clan)
            {
                param = ParseBtnSpite(TransmitAndInviteType.ClanInvite);
            }
            else if (msg.msgType == PushMsg.MsgType.TeamLeaderCallFollow)
            {
                param = ParseBtnSpite(TransmitAndInviteType.TeamLeaderCallFollow);
            }
            else if (msg.msgType == PushMsg.MsgType.TokenTaskReward)
            {
                param = ParseBtnSpite(TransmitAndInviteType.TokenTaskReward);
            }
            if (param != null)
            {
                m_spriteIcon.spriteName  = param.iconName;
                m_spriteTitle.spriteName = param.titleName;
            }
        }
    }