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().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)); } }