48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ListItem : MonoBehaviour
|
|
{
|
|
public int list;
|
|
public TextMeshProUGUI listText;//排名
|
|
public Image listImage;//排名徽章图片
|
|
public Image headImage;//头像
|
|
public TextMeshProUGUI nameText;//名字
|
|
public TextMeshProUGUI numText;//蜗牛蛋数量
|
|
public Image Bg;//背景图片
|
|
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
public void SetListImage()//设排名徽章背景颜色
|
|
{
|
|
if (list == 1)
|
|
{
|
|
listImage.sprite = Resources.Load<Sprite>("bgYello");
|
|
}
|
|
else if (list == 2)
|
|
{
|
|
listImage.sprite = Resources.Load<Sprite>("bgGreen");
|
|
}
|
|
else if (list == 3)
|
|
{
|
|
listImage.sprite = Resources.Load<Sprite>("bgBlue");
|
|
}
|
|
else
|
|
{
|
|
listImage.sprite = Resources.Load<Sprite>("bgred");
|
|
}
|
|
|
|
}
|
|
public void ListBgImage()//设排名徽章背景颜色
|
|
{
|
|
|
|
|
|
}
|
|
}
|