先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
65 lines
1.2 KiB
C#
65 lines
1.2 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|