备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class EventScratchTicketRewardPopupPanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private RewardItemNew reward;
|
||||
//[SerializeField] private GameObject[] gemBanners;
|
||||
[SerializeField] private Image banner;
|
||||
[SerializeField] private Button btnClaim;
|
||||
private Action _action;
|
||||
|
||||
public void Init(ItemData rewardItem, EventScratchCard eventScratchCard, Action claimMark = null)
|
||||
{
|
||||
var dataManager = GContext.container.Resolve<EventScratchTicketDataManager>();
|
||||
|
||||
// Debug.Log($"[EventBreak] Init!!!!!!!!!!", this);
|
||||
reward.SetData(rewardItem, abbr: true);
|
||||
//for (int i = 0; i < gemBanners.Length; i++)
|
||||
// gemBanners[i].SetActive(i == tunnelIdx);
|
||||
banner.sprite = dataManager.SpriteAtlas.GetSprite(eventScratchCard.RewardIcon);
|
||||
btnClaim.onClick.AddListener(OnClaim);
|
||||
_action = claimMark;
|
||||
}
|
||||
|
||||
private void OnClaim()
|
||||
{
|
||||
// Debug.Log($"[EventBreak] Claim!!!!!!!!!!", this);
|
||||
var dataManager = GContext.container.Resolve<EventScratchTicketDataManager>();
|
||||
UIManager.Instance.DestroyUI(dataManager.GetRewardPanel());
|
||||
_action?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user