blob: d2c6d4d426dcda65b87c1f14dcd308f918a5bd6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public struct UIItemWidgetParam
{
public ItemBase item;
}
public class UIItemWidget : UIGridPropBase
{
public Image Image_Icon;
public Text Text_Count;
public ItemBase item { get { return m_Item; } }
private ItemBase m_Item;
public override void Set(object param)
{
UIItemWidgetParam info = (UIItemWidgetParam)param;
m_Item = info.item;
Image_Icon.sprite = ResourceManager.Instance.Load<Sprite>(info.item.iconPath);
int n = Random.Range(1, 20);
Text_Count.gameObject.SetActive(n > 1);
Text_Count.text = n.ToString();
}
}
|