先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using asap.core;
|
|
using Game;
|
|
using GameCore;
|
|
using Spine.Unity;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class RewardPopupPanel_Fishcard : MonoBehaviour
|
|
{
|
|
public SkeletonGraphic curAnimation;
|
|
[SerializeField] float _fxDelay = 0.3f;
|
|
[SerializeField] float _fxDisappearDelay = 1.6f;
|
|
|
|
ItemData data;
|
|
|
|
public void Open(ItemData data)
|
|
{
|
|
this.data = data;
|
|
StartCoroutine(PlayOpenOn());
|
|
}
|
|
IEnumerator PlayOpenOn()
|
|
{
|
|
//打开全部开启按钮
|
|
//隐藏下一个按钮
|
|
if (curAnimation != null)
|
|
{
|
|
curAnimation.gameObject.SetActive(false);
|
|
}
|
|
|
|
Transform bg_num = curAnimation.transform.Find("bg_num");
|
|
bg_num.gameObject.SetActive(data.count > 1);
|
|
if (data.count > 1)
|
|
{
|
|
bg_num.Find("text_num").GetComponent<TMP_Text>().text = $"x{data.count}";
|
|
}
|
|
curAnimation.gameObject.SetActive(true);
|
|
|
|
curAnimation.AnimationState.SetAnimation(0, "Show01", false);
|
|
yield return new WaitForSeconds(0.333f);
|
|
curAnimation.AnimationState.SetAnimation(0, "Open01", false);
|
|
GContext.Publish(new EventUISound("audio_ui_box_open"));
|
|
//Debug.Log($"Animation Open Played! Idx: {curAnimationIdx}");
|
|
yield return new WaitForSeconds(_fxDelay);
|
|
GameObject fx = curAnimation.transform.GetChild(0).gameObject;
|
|
fx.SetActive(false);
|
|
fx.SetActive(true);
|
|
yield return new WaitForSeconds(_fxDisappearDelay - _fxDelay);
|
|
fx.SetActive(false);
|
|
if (curAnimation != null)
|
|
{
|
|
curAnimation.gameObject.SetActive(false);
|
|
}
|
|
//下一个按钮打开
|
|
UIManager.Instance.DestroyUI(this.gameObject.name);
|
|
GContext.Publish(new game.ShowData(game.RewardType.Destroy));
|
|
|
|
}
|
|
}
|