Esempio n. 1
0
    public void SendData(PvPRankWindow parent, PVPData.PvPRankListItemInfo data)
    {
        Cleanup();
        m_Parent = parent;
        m_data   = data;

        if (data.pos <= 3)
        {
            if (data.pos == 1)
            {
                m_RankIcon.spriteName = "Icon-Rank01";
            }

            else if (data.pos == 2)
            {
                m_RankIcon.spriteName = "Icon-Rank02";
            }

            else if (data.pos == 3)
            {
                m_RankIcon.spriteName = "Icon-Rank03";
            }

            m_RankPlayerName.text = data.name;
            m_RankPlayerIcon.gameObject.SetActive(true);
            m_RankPlayerLevel.text = data.level.ToString();
        }
        else
        {
            m_Label1.text = data.pos.ToString();
            m_Label2.text = data.name;
            m_Label4.text = data.level.ToString();
        }
        m_Label5.text = data.com.ToString();
        m_Label6.text = TableManager.GetPvpRankByID(data.pos, 0).Vlue.ToString();
        m_RankPlayerIcon.spriteName = Utils.GetHeadPicByProfession((int)data.profession);
        m_proIcon.spriteName        = Utils.GetProfessionIcon((int)data.profession);
    }
Esempio n. 2
0
    public void OnClickItem(PvPRankListItem thisItem)
    {
        if (thisItem != null)
        {
            CurItem = thisItem;
        }
        if (CurItem != null)
        {
            m_CurData = CurItem.GetData();

            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

            if (_mainPlayer == null)
            {
                return;
            }

            bool canChaengeHiger = VipData.CanChallengeHigher();
            if (m_CurData.id == _mainPlayer.GUID)
            {
                canChaengeHiger = false;
            }
            if (canChaengeHiger && m_CurData.pos >= 0 && m_CurData.pos < 100)
            {
                if (MenuOp != null)
                {
                    MenuOp.SetActive(true);
                }
            }
            else
            {
                if (MenuOp != null)
                {
                    MenuOp.SetActive(false);
                }
            }
        }
    }
Esempio n. 3
0
    public static PvPRankListItem CreateItem(GameObject grid, GameObject resItem, PvPRankWindow parent, string name, PVPData.PvPRankListItemInfo data)
    {
        GameObject curItem = Utils.BindObjToParent(resItem, grid, name);

        if (null != curItem)
        {
            PvPRankListItem curItemComponent = curItem.GetComponent <PvPRankListItem>();
            if (null != curItemComponent)
            {
                curItemComponent.SendData(parent, data);
            }
            return(curItemComponent);
        }

        return(null);
    }