38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using UnityEngine;
|
|
using GameCore;
|
|
using UnityEngine.UI;
|
|
using System.Collections.Generic;
|
|
|
|
public class OfferTreasureAscentGrandRewardView : MonoBehaviour
|
|
{
|
|
[SerializeField] private RewardItemNew reward;
|
|
[SerializeField] private GameObject goDone;
|
|
[SerializeField] protected OfferTreasureAscentGrandRewardTip tip;
|
|
[SerializeField] protected Button btnTip;
|
|
public List<ItemData> RewardItems { get; private set; } = new List<ItemData>();
|
|
|
|
protected virtual void Start()
|
|
{
|
|
btnTip.onClick.AddListener(ShowTip);
|
|
tip.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void Init(ItemData item, float? inflationRate = null)
|
|
{
|
|
reward.SetData(item);
|
|
goDone.SetActive(false);
|
|
RewardItems = FtUtils.ResolveChestContent(item.id, inflationRate);
|
|
tip.Init(RewardItems);
|
|
}
|
|
|
|
public void SetClaimed(bool isClaimed = true)
|
|
{
|
|
goDone.SetActive(isClaimed);
|
|
}
|
|
|
|
protected virtual void ShowTip()
|
|
{
|
|
tip.gameObject.SetActive(true);
|
|
}
|
|
}
|