先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using GameCore;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StarItemRoot : MonoBehaviour
|
|
{
|
|
public List<GameObject> enhance_star_empty_list = new List<GameObject>();
|
|
public List<Image> enhance_star_empty_image = new List<Image>();
|
|
public List<StarItem> enhance_starList = new List<StarItem>();
|
|
private void Reset()
|
|
{
|
|
for (int i = 1; i <= 5; i++)
|
|
{
|
|
enhance_starList.Add(transform.Find($"star/star{i}").GetComponent<StarItem>());
|
|
enhance_star_empty_list.Add(transform.Find($"star_empty/star{i}").gameObject);
|
|
enhance_star_empty_image.Add(transform.Find($"star_empty/star{i}/star").GetComponent<Image>());
|
|
}
|
|
}
|
|
public void SetStar(int star, int maxAscent, bool isUp = false)
|
|
{
|
|
PlayerFishData.SetRodStar(star, maxAscent,
|
|
enhance_star_empty_list,
|
|
enhance_star_empty_image,
|
|
enhance_starList,
|
|
isUp);
|
|
}
|
|
public void ShowStar(int star, int maxAscent)
|
|
{
|
|
int max = maxAscent / 3;
|
|
if (max > 5)
|
|
{
|
|
max = 5;
|
|
Debug.LogError($"钓竿最大强化星级不能超过15星");
|
|
}
|
|
int count = star % max;
|
|
if (star >= maxAscent)
|
|
{
|
|
count = max;
|
|
}
|
|
StopAllCoroutines();
|
|
StartCoroutine(ShowStar(count));
|
|
}
|
|
IEnumerator ShowStar(int count)
|
|
{
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
enhance_starList[i].Hide();
|
|
}
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
enhance_starList[i].PlayShow();
|
|
yield return new WaitForSeconds(0.1f);
|
|
}
|
|
}
|
|
}
|