You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
591 B
28 lines
591 B
2 years ago
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using UIWidgets;
|
||
|
|
||
|
namespace UIWidgetsSamples {
|
||
|
public class ListViewUnderlineSampleComponent : ListViewItem {
|
||
|
// specify components for displaying item data
|
||
|
[SerializeField]
|
||
|
public Image Icon;
|
||
|
|
||
|
[SerializeField]
|
||
|
public Text Text;
|
||
|
|
||
|
[SerializeField]
|
||
|
public Image Underline;
|
||
|
|
||
|
// Displaying item data
|
||
|
public void SetData(ListViewUnderlineSampleItemDescription item)
|
||
|
{
|
||
|
Icon.sprite = item.Icon;
|
||
|
Text.text = item.Name;
|
||
|
|
||
|
Icon.SetNativeSize();
|
||
|
|
||
|
Icon.color = (Icon.sprite==null) ? Color.clear : Color.white;
|
||
|
}
|
||
|
}
|
||
|
}
|