Files
5.24BuYu/Assets/MyGame/aa/UI/Home/Sub/BackPack/BackPackPropItem.cs
T
2026-06-25 01:48:07 +08:00

39 lines
983 B
C#

using Assets.Framework.Tool;
using Assets.MyGame.Scripts.Net;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
[Serializable]
public enum PropEnum
{
none=0
}
public class BackPackPropItem : MonoBehaviour
{
public List<Image> item_Bg;
public Dictionary<PropEnum, Image> item_Type=new Dictionary<PropEnum, Image>();
public Image img_Prop;
public TextMeshProUGUI propCount;
public void Init(string url,int propCount, PropEnum propEnum= PropEnum.none)
{
switch (propEnum)
{
case PropEnum.none:
item_Bg[0].gameObject.SetActive(true);
break;
default:
break;
}
WebTool.DownImage(url, (texture) =>
{
img_Prop.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f);
});
}
}