using System.Collections; using UnityEngine; using Wizard; public class MyPageBattleCampaign : MonoBehaviour { [SerializeField] private UILabel _timeLabel; [SerializeField] private GameObject _boxRoot; [SerializeField] private UILabel _boxLabel; [SerializeField] private UISprite _boxSprite; [SerializeField] private UILabel _specialBoxLabel; [SerializeField] private UISprite _specialBoxSprite; public IEnumerator Init() { base.gameObject.SetActive(value: false); while (Data.MyPage.data == null) { yield return null; } _specialBoxLabel.gameObject.SetActive(value: false); _specialBoxSprite.gameObject.SetActive(value: false); CampaignBattleWin campaignBattleWin = Data.MyPageNotifications.data.CampaignBattleWin; if (campaignBattleWin.IsInSessionCampaign) { base.gameObject.SetActive(value: true); _timeLabel.text = Data.SystemText.Get("MyPage_0048", ConvertTime.ToLocal(ConvertTime.UnixTimeToDateTime(campaignBattleWin.EndUnixTime))); if (campaignBattleWin.BoxGrade == CampaignBattleWin.eBoxGrade.None) { _boxLabel.width = 50; _boxLabel.text = Data.SystemText.Get("MyPage_0046", campaignBattleWin.GetBoxNum.ToString(), campaignBattleWin.MaxBoxNum.ToString()); _boxSprite.spriteName = "box_campaign_00"; if (campaignBattleWin.IsHaveSpecialWinReward && !campaignBattleWin.SpecialTreasureInfo.IsGotSpecialTreasureBox) { _boxRoot.transform.localPosition = new Vector3(-90f, _boxRoot.transform.localPosition.y, _boxRoot.transform.localPosition.z); _specialBoxLabel.gameObject.SetActive(value: true); _specialBoxSprite.gameObject.SetActive(value: true); } } else { _boxLabel.width = 150; _boxLabel.text = Data.SystemText.Get("MyPage_0047"); _boxSprite.spriteName = "box_campaign_" + ((int)(campaignBattleWin.BoxGrade - 1)).ToString("00"); } } else { base.gameObject.SetActive(value: false); } } }