using asap.core; using DG.Tweening; using GameCore; using System; using System.Collections; using System.Collections.Generic; using TMPro; using UniRx; using UnityEngine; using UnityEngine.UI; public struct RefreshPanelEvent { } /// /// 由 实现:列表行上点领奖时先走路、砸,再发奖。 /// public interface IMiniBattlePassAnimatedClaim { bool ClaimAnimationInProgress { get; } /// true 表示已交给面板播动画,调用方勿再直接 ReceiveReward bool TryScheduleClaim(int tierIndex, bool isFreeReward); } public class MiniBattlePassPanel : MonoBehaviour { [SerializeField] protected MiniBattlePassType Type = MiniBattlePassType.LuckMagic; protected virtual int NormalizedPosition => 1; protected MiniBattlePassDataModel miniBP; Button btn_close; TMP_Text text_time; protected GameObject buy; Button btn_buy; protected Button btn_claim; protected Button btn_claim_gray; protected GameObject claim; GameObject done; protected TMP_Text text_buy; protected GameObject item; protected RectTransform contentRect; protected Transform content; protected ScrollRect scrollRect; protected VerticalLayoutGroup layoutGroup; int addSizeDelta; int startAdd; protected float itemHeight = 164f; protected float allHeight = 0f; protected virtual int showCount => 2; protected List miniBPItemDatas; protected List miniBattlePassItems = new List(); protected CompositeDisposable disposables = new CompositeDisposable(); protected string timerFormat; protected virtual void Awake() { miniBP = GContext.container.Resolve().GetModel(Type); miniBP.SetPanelData(); item = transform.Find("root/ScrollView/Viewport/Content/item").gameObject; item.SetActive(false); scrollRect = transform.Find("root/ScrollView").GetComponent(); content = transform.Find("root/ScrollView/Viewport/Content"); contentRect = content.GetComponent(); layoutGroup = content.GetComponent(); float spacing = layoutGroup.spacing; addSizeDelta = layoutGroup.padding.vertical; startAdd = layoutGroup.padding.top; itemHeight = item.GetComponent().sizeDelta.y + spacing; btn_close = transform.Find("root/btn_close").GetComponent