|
|
@@ -18,11 +18,17 @@ namespace GFGGame
|
|
|
public class BlindBoxView : BaseWindow
|
|
|
{
|
|
|
private UI_BlindBoxUI _ui;
|
|
|
+
|
|
|
//private EffectUI _effectUI1;
|
|
|
private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
private ItemCfg itemcfg;
|
|
|
+
|
|
|
private int listIndex = 0;
|
|
|
- BlindBoxCfg blindBoxCfg = BlindBoxCfgArray.Instance.GetCfg(2);
|
|
|
+
|
|
|
+ //TODO 每次开盲盒要在这里写盲盒的id
|
|
|
+ private const int _blindBoxId = 3;
|
|
|
+ BlindBoxCfg blindBoxCfg = BlindBoxCfgArray.Instance.GetCfg(_blindBoxId);
|
|
|
+
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
// EffectUIPool.Recycle(_effectUI1);
|
|
|
@@ -58,12 +64,12 @@ namespace GFGGame
|
|
|
_ui.m_rewardList.onClick.Add(OnClickRewardBtn);
|
|
|
_ui.m_ruleBtn.onClick.Add(OnClickRuleBtn);
|
|
|
_ui.m_rewardList.itemRenderer = RenderRewardList;
|
|
|
-
|
|
|
+
|
|
|
List<DropOutCfg> dropOutCfgList = DropOutCfgArray.Instance.GetCfgsByid(blindBoxCfg.OrdinaryDropDisplay);
|
|
|
List<DropOutCfg> hidDropOutCfgList = DropOutCfgArray.Instance.GetCfgsByid(blindBoxCfg.HideDropDisplay);
|
|
|
ItemCfg hidItemCfg = ItemCfgArray.Instance.GetCfg(hidDropOutCfgList[0].item);
|
|
|
_ui.m_rewardList.numItems = dropOutCfgList.Count;
|
|
|
- _ui.m_hiddenItem.url = ResPathUtil.GetIconPath(hidItemCfg);
|
|
|
+ _ui.m_hiddenItem.url = ResPathUtil.GetIconPath(hidItemCfg);
|
|
|
_ui.m_buyBtn.m_num.text = blindBoxCfg.CostIDNumArr[1].ToString();
|
|
|
|
|
|
_ui.m_boxList.itemRenderer = RenderBoxList;
|
|
|
@@ -82,7 +88,7 @@ namespace GFGGame
|
|
|
Log.Error(string.Format("没有{0}物品"));
|
|
|
}
|
|
|
|
|
|
- _ui.m_buyBtn.m_newimg.url = "ui://eg2y0ldpuje19g0w";
|
|
|
+ _ui.m_buyBtn.m_newimg.url = "ui://eg2y0ldpuje19g0w";
|
|
|
// _ui.m_buyBtn.m_img.width = 5;
|
|
|
_ui.m_boxList.numItems = 6;
|
|
|
_ui.m_rewardList.numItems = 6;
|
|
|
@@ -115,7 +121,11 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickRewardBtn()
|
|
|
{
|
|
|
- ViewManager.Show<BlindBoxRewardView>(new object[] { 30000066, 30000078 });
|
|
|
+ ViewManager.Show<BlindBoxRewardView>(new object[]
|
|
|
+ {
|
|
|
+ blindBoxCfg.OrdinaryDropDisplay,
|
|
|
+ blindBoxCfg.HideDropDisplay
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void OnClickRuleBtn()
|
|
|
@@ -128,10 +138,10 @@ namespace GFGGame
|
|
|
UI_rewardItem uiItemChild = UI_rewardItem.Proxy(obj);
|
|
|
List<DropOutCfg> dropOutCfgList = DropOutCfgArray.Instance.GetCfgsByid(blindBoxCfg.OrdinaryDropDisplay);
|
|
|
ItemCfg itemCfgChild = ItemCfgArray.Instance.GetCfg(dropOutCfgList[index].item);
|
|
|
-
|
|
|
+
|
|
|
uiItemChild.target.data = itemCfgChild;
|
|
|
uiItemChild.m_reward.url = ResPathUtil.GetIconPath(itemCfgChild);
|
|
|
-
|
|
|
+
|
|
|
UI_rewardItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
@@ -174,7 +184,7 @@ namespace GFGGame
|
|
|
private async void ReqBuyAll()
|
|
|
{
|
|
|
bool result;
|
|
|
- result = await LuckyBoxSProxy.ReqGetBlindBox(2, 6);
|
|
|
+ result = await LuckyBoxSProxy.ReqGetBlindBox(_blindBoxId, 6);
|
|
|
if (result)
|
|
|
{
|
|
|
UpdateAllBoxAni();
|
|
|
@@ -184,7 +194,7 @@ namespace GFGGame
|
|
|
private async void ReqBuyOne()
|
|
|
{
|
|
|
bool result;
|
|
|
- result = await LuckyBoxSProxy.ReqGetBlindBox(2, 1);
|
|
|
+ result = await LuckyBoxSProxy.ReqGetBlindBox(_blindBoxId, 1);
|
|
|
if (result)
|
|
|
{
|
|
|
UI_boxItem listItem = UI_boxItem.Proxy(_ui.m_boxList.GetChildAt(listIndex));
|
|
|
@@ -262,7 +272,7 @@ namespace GFGGame
|
|
|
private void UpdateTime(object param)
|
|
|
{
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
- var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(10302);
|
|
|
+ var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(10303);
|
|
|
if (activityInfo != null)
|
|
|
{
|
|
|
long endTime = activityInfo.EndTime;
|