37 lines
684 B
C#
37 lines
684 B
C#
using UIWidgets;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace UIWidgetsSamples
|
|
{
|
|
public class ListViewCustomSampleComponent : ListViewItem
|
|
{
|
|
[SerializeField]
|
|
public Image Icon;
|
|
|
|
[SerializeField]
|
|
public Text Text;
|
|
|
|
[SerializeField]
|
|
public Progressbar Progressbar;
|
|
|
|
public void SetData(ListViewCustomSampleItemDescription item)
|
|
{
|
|
if (item == null)
|
|
{
|
|
Icon.sprite = null;
|
|
Text.text = string.Empty;
|
|
Progressbar.Value = 0;
|
|
}
|
|
else
|
|
{
|
|
Icon.sprite = item.Icon;
|
|
Text.text = item.Name;
|
|
Progressbar.Value = item.Progress;
|
|
}
|
|
Icon.SetNativeSize();
|
|
Icon.color = ((!(Icon.sprite == null)) ? Color.white : Color.clear);
|
|
}
|
|
}
|
|
}
|