Example #1
0
    //init ui data
    void InitUIData(PlayerData playerData)
    {
        TextRoleName.text = playerData.BasicData.Name + "";
        FansLabel.text    = HelpUtil.GetMoneyFormattedText(playerData.starData.nRoleFenSi);

        SuperFsanLabel.text = Globals.Instance.MGameDataManager.MActorData.WarshipList.Count.ToString();
        TimeNumLabel.text   = "X" + playerData.WealthData.Oil.ToString();

//		if(Globals.Instance.MTaskManager.urlTexture!=null)
//		{
//			AvatarIconTexture.mainTexture = Globals.Instance.MTaskManager.urlTexture.URLTexture;
//		}
//		else
//		{
//			AvatarIconTexture.mainTexture = Resources.Load("Icon/AvatarIcon/GirlAvatar03",typeof(Texture2D)) as Texture2D;
//		}
    }
    public void UpdateSlot(ItemSlotData data)
    {
        ItemData = data;
        itemIconSlot.SetItemData(data);

        name.Text   = data.MItemData.GetDisplayName();
        pinzhi.Text = data.MItemData.GetDisplayQualityName();

        if (data.SlotType == ItemSlotType.SHOP)
        {
            yinLiangIcon.transform.localScale = Vector3.one;
            price.transform.localScale        = Vector3.one;

            desc.transform.localScale = Vector3.one;
            desc.Text = data.MItemData.BasicData.Description;

            property.transform.localScale   = Vector3.zero;
            prompt.transform.localScale     = Vector3.zero;
            pingfen.transform.localScale    = Vector3.zero;
            strengthen.transform.localScale = Vector3.zero;
        }
        else if (data.SlotType == ItemSlotType.CLOTH_BAG ||
                 data.SlotType == ItemSlotType.TEMP_BAG ||
                 data.SlotType == ItemSlotType.EQU_CARD_BAG)
        {
            yinLiangIcon.transform.localScale = Vector3.zero;
            price.transform.localScale        = Vector3.zero;
            desc.transform.localScale         = Vector3.zero;
            pingfen.transform.localScale      = Vector3.zero;

            property.transform.localScale   = Vector3.one;
            prompt.transform.localScale     = Vector3.one;
            strengthen.transform.localScale = Vector3.one;
        }

        SetPropText(data);

        string tColor;

        if (Globals.Instance.MGameDataManager.MActorData.BasicData.Level >= data.MItemData.BasicData.UseLevelLimit)
        {
            tColor = GUIFontColor.LimeGreen089210000;
        }
        else
        {
            tColor = GUIFontColor.DarkRed210000005;
        }
        prompt.Text = tColor + string.Format(Globals.Instance.MDataTableManager.GetWordText(10829999), data.MItemData.BasicData.UseLevelLimit);


        if (data.SlotType == ItemSlotType.SHOP)
        {
            price.Text = HelpUtil.GetMoneyFormattedText(data.MItemData.BasicData.BuyPrice);
        }
        else if (data.SlotType == ItemSlotType.CLOTH_BAG ||
                 data.SlotType == ItemSlotType.SHIP_EQUIPMENT)
        {
            price.Text = HelpUtil.GetMoneyFormattedText(data.MItemData.BasicData.SellPrice);
        }

        bool hasEquiped = false;

        if (hasEquiped)
        {
            hasEquipedText.transform.parent.localScale = Vector3.one;
        }
        else
        {
            hasEquipedText.transform.parent.localScale = Vector3.zero;
        }
    }