summaryrefslogtreecommitdiff
path: root/SurvivalTest/Assets/Scripts/UI/Panel/PanelItemBar/UIItemWidget.cs
blob: 93ff6f14799a61b38acbf4c6ffc1f17a93337756 (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
34
35
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();

		Text_Count.gameObject.SetActive(false);

	}

}