备份CatanBuilding瘦身独立工程
This commit is contained in:
55
Assets/Scripts/UI/Potion/EventPotionRewardPopupPanel.cs
Normal file
55
Assets/Scripts/UI/Potion/EventPotionRewardPopupPanel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using asap.core;
|
||||
using GameCore;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class EventPotionRewardPopupPanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button btnNormal;
|
||||
[SerializeField] private GameObject rewardRoot;
|
||||
[SerializeField] private ShootingRewardLayout normalRewardLayout;
|
||||
IDisposable disposable;
|
||||
public void Init(List<ItemData> rewardItems, bool isFinalStage = false)
|
||||
{
|
||||
btnNormal.onClick.AddListener(OnClickClaim);
|
||||
rewardRoot.SetActive(true);
|
||||
normalRewardLayout.SetRewards(rewardItems, true);
|
||||
}
|
||||
|
||||
private void OnClickClaim()
|
||||
{
|
||||
CurRewardQCount curRewardQCount = new CurRewardQCount();
|
||||
GContext.Publish(curRewardQCount);
|
||||
if (curRewardQCount.count <= 0)
|
||||
{
|
||||
Exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
disposable = GContext.OnEvent<RewardPanelClose>().Subscribe(OnRewardPanelClose);
|
||||
GContext.Publish(new ShowData());
|
||||
}
|
||||
}
|
||||
|
||||
void OnRewardPanelClose(RewardPanelClose rewardPanelClose)
|
||||
{
|
||||
Exit();
|
||||
}
|
||||
|
||||
void Exit()
|
||||
{
|
||||
disposable?.Dispose();
|
||||
disposable = null;
|
||||
FishingPotionAct.Publish<EventPotionCloseCameraData>(new EventPotionCloseCameraData());
|
||||
// 关闭当前Act
|
||||
GContext.Publish(new UnloadActToNextAct());
|
||||
UIManager.Instance.DestroyUI(UITypes.EventPotionRewardPopupPanel);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user