备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
using UnityEngine;
using UnityEngine.UI;
public class StarItem : MonoBehaviour
{
public Image[] Star;
public Animation ani;
//private void Reset()
//{
// Awake();
//}
private void Awake()
{
ani = GetComponent<Animation>();
int count = transform.childCount;
Star = new Image[count];
for (int i = 0; i < count; i++)
{
Star[i] = transform.GetChild(i).GetComponent<Image>();
}
}
public void SetStar(int index)
{
for (int i = 0; i < Star.Length; i++)
{
Star[i].gameObject.SetActive(index == i + 1);
}
}
public void PlayAni()
{
if (ani)
{
ani.Play("star_enhance");
}
}
public void Hide()
{
CanvasGroup cg = GetComponent<CanvasGroup>();
if (cg)
{
cg.alpha = 0;
}
}
public void PlayShow()
{
CanvasGroup cg = GetComponent<CanvasGroup>();
if (cg)
{
cg.alpha = 1;
}
if (ani)
{
ani.Play("star_show");
}
}
public void PlayHuXi()
{
if (ani)
{
ani.Play("star_huxi");
}
}
}