using Coffee.UIEffects; using IVDataFormat; using TMPro; using UnityEngine; public class PvpRewItem : MonoBehaviour { private TextMeshProUGUI txtCond; private GoodsItem goodsRew; private UIShiny shinyRew; private GameObject goBadge; private GameObject goClose; private GameObject goClear; //private GameObject goLineL; public void InitCell() { Transform trfself = transform; txtCond = trfself.Find("txtCond").GetComponent(); goodsRew = trfself.Find("GoodsItem").GetComponent(); shinyRew = goodsRew.transform.Find("icon").GetComponent(); goBadge = trfself.Find("badge").gameObject; goClose = trfself.Find("close").gameObject; goClear = trfself.Find("clear").gameObject; //goLineL = trfself.Find("linel").gameObject; } public void SetFloat(float fvalue) { shinyRew.effectFactor = fvalue; } public void SetData(int itemid) { //goLineL.SetActive(itemid == 0); dPvpRew rewdata = DataHandler.GetPvpReward(itemid); txtCond.text = FormatString.StringFormat(LocalizationText.GetText("all_trycnt"), rewdata.condValue); goodsRew.SetGoods(rewdata.rewardType, rewdata.rewardId, rewdata.rewardCount, true); int iavailrew = DataHandler.playPvp.availWeeklyIndex < 0 ? 0 : DataHandler.GetPvpReward(DataHandler.playPvp.availWeeklyIndex).id; int ihaverew = DataHandler.playPvp.rewardWeekly; goBadge.SetActive(ihaverew < rewdata.id && iavailrew >= rewdata.id); goClear.SetActive(ihaverew >= rewdata.id); goClose.SetActive(goClear.activeSelf); } public void BtnGetReward() { if (!goClose.activeSelf && goBadge.activeSelf) { SoundMgr.Instance.PlaySfx(SoundName.BtnPress); PvpMgr.SGetReward(); } } }