新背包ui
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user