ItemTest.cs
552 Bytes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public struct ItemInfo
{
public int Id;
public bool IsChoose;
public string IconName;
}
public class ItemTest : BaseItem<ItemInfo>
{
void Start()
{
}
void Update()
{
}
public override void SetSelected(bool selected)
{
base.SetSelected(selected);
gameObject.transform.GetChild(0).GetComponent<Image>().color = selected ? Color.red : Color.yellow;
}
}