|
|
@@ -1,10 +1,10 @@
|
|
|
-using UnityEngine;
|
|
|
using FairyGUI;
|
|
|
using UI.LuckyBox;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Collections;
|
|
|
using cfg.GfgCfg;
|
|
|
using ET;
|
|
|
+using System;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
@@ -13,25 +13,31 @@ namespace GFGGame
|
|
|
private UI_LuckBoxBonusShowUI _ui;
|
|
|
private List<ItemData> _rewardList = new List<ItemData>();
|
|
|
private List<ItemData> _rewardItemList = new List<ItemData>();
|
|
|
- private Dictionary<int, Dictionary<int, EffectUI>> _effListTen = new Dictionary<int, Dictionary<int, EffectUI>>();
|
|
|
+
|
|
|
+ private Dictionary<int, Dictionary<int, EffectUI>> _effListTen =
|
|
|
+ new Dictionary<int, Dictionary<int, EffectUI>>();
|
|
|
+
|
|
|
private Dictionary<int, EffectUI> _effList = new Dictionary<int, EffectUI>();
|
|
|
private Dictionary<int, bool> _itemHasNew = new Dictionary<int, bool>();
|
|
|
|
|
|
private Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
|
|
|
private Dictionary<int, GComponent> _itemObjList = new Dictionary<int, GComponent>();
|
|
|
- private List<int> _recordOpenIndex = new List<int>(); //记录打开过得item位置
|
|
|
- private List<int> _recordTurnIndex = new List<int>(); //记录播放过item位置
|
|
|
- private int _chooseIndex = -1; //当前选中的index
|
|
|
- private int _countShow = 0; //第几次展示
|
|
|
- private bool _handClick = false; //手动点击开启
|
|
|
- private bool _AnimationWait = true; //抽卡动画等待加载完毕
|
|
|
- bool _touchLoaBg = true; //防止点击背景事件太快
|
|
|
+ private List<int> _recordOpenIndex = new List<int>(); //记录打开过得item位置
|
|
|
+ private List<int> _recordTurnIndex = new List<int>(); //记录播放过item位置
|
|
|
+ private int _chooseIndex = -1; //当前选中的index
|
|
|
+ private int _countShow = 0; //第几次展示
|
|
|
+ private bool _handClick = false; //手动点击开启
|
|
|
+ private bool _AnimationWait = true; //抽卡动画等待加载完毕
|
|
|
+ bool _touchLoaBg = true; //防止点击背景事件太快
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI2;
|
|
|
private EffectUI _effectUI3;
|
|
|
private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
|
|
|
+ private bool _allEffectsLoaded = false;
|
|
|
+ private int _loadingEffectCount = 0;
|
|
|
+
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
|
@@ -41,6 +47,19 @@ namespace GFGGame
|
|
|
EffectUIPool.Recycle(_effectUI3);
|
|
|
_effectUI3 = null;
|
|
|
|
|
|
+ ClearAllEffects();
|
|
|
+
|
|
|
+ if (_ui != null)
|
|
|
+ {
|
|
|
+ _ui.Dispose();
|
|
|
+ _ui = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ base.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ClearAllEffects()
|
|
|
+ {
|
|
|
for (int key = 0; key < _effListTen.Count; key++)
|
|
|
{
|
|
|
if (_effListTen.ContainsKey(key))
|
|
|
@@ -55,6 +74,7 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
_effListTen.Clear();
|
|
|
|
|
|
for (int key = 0; key < _effList.Count; key++)
|
|
|
@@ -65,14 +85,15 @@ namespace GFGGame
|
|
|
_effList[key] = null;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
_effList.Clear();
|
|
|
|
|
|
- if (_ui != null)
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
{
|
|
|
- _ui.Dispose();
|
|
|
- _ui = null;
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
}
|
|
|
- base.Dispose();
|
|
|
+
|
|
|
+ _effectUIDic.Clear();
|
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
|
@@ -84,17 +105,7 @@ namespace GFGGame
|
|
|
isfullScreen = true;
|
|
|
|
|
|
_ui.m_loaBg.onClick.Add(OnClickLoaBg);
|
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
-
|
|
|
_ui.m_BtnPass.onClick.Add(OnClickBtnPass);
|
|
|
-
|
|
|
- UpdateEffect();
|
|
|
- }
|
|
|
- private void UpdateEffect()
|
|
|
- {
|
|
|
- _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holder_star, "ui_LuckyBox", "bg_liuxing");
|
|
|
- _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holder_bg, "ui_LuckyBox", "CK_UI");
|
|
|
- _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holder_cloud, "ui_LuckyBox", "bg_cloud");
|
|
|
}
|
|
|
|
|
|
protected override void AddEventListener()
|
|
|
@@ -113,36 +124,13 @@ namespace GFGGame
|
|
|
EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_SHOW_VIEW_CLOSE, OthershowViewClose);
|
|
|
}
|
|
|
|
|
|
- protected void OthershowViewClose()
|
|
|
- {
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
- }
|
|
|
-
|
|
|
- protected void ReferNextShow()
|
|
|
- {
|
|
|
- if (GetSuitItemController.isAuto)
|
|
|
- return;
|
|
|
-
|
|
|
- int suitId = 0;
|
|
|
- if(_itemIdList.ContainsKey(_chooseIndex))
|
|
|
- suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[_chooseIndex]);
|
|
|
-
|
|
|
- if (_chooseIndex != -1 && suitId > 0)
|
|
|
- ClickItem(_chooseIndex);
|
|
|
- else
|
|
|
- {
|
|
|
- if (_handClick)
|
|
|
- {
|
|
|
- _handClick = false;
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
+
|
|
|
+ _allEffectsLoaded = false;
|
|
|
_touchLoaBg = false;
|
|
|
+ _rewardList.Clear();
|
|
|
_rewardList.AddRange(this.viewData as List<ItemData>);
|
|
|
_itemIdList.Clear();
|
|
|
_itemObjList.Clear();
|
|
|
@@ -151,7 +139,37 @@ namespace GFGGame
|
|
|
_itemHasNew.Clear();
|
|
|
_ui.m_BtnPass.visible = false;
|
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
|
-
|
|
|
+
|
|
|
+ _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
+
|
|
|
+ // 异步加载所有特效
|
|
|
+ Timers.inst.StartCoroutine(LoadAllEffects(() =>
|
|
|
+ {
|
|
|
+ _allEffectsLoaded = true;
|
|
|
+ SetupViewAfterEffectsLoaded();
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ private IEnumerator LoadAllEffects(Action onComplete)
|
|
|
+ {
|
|
|
+ // 加载背景特效
|
|
|
+ _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holder_star, "ui_LuckyBox", "bg_liuxing");
|
|
|
+ _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holder_bg, "ui_LuckyBox", "CK_UI");
|
|
|
+ _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holder_cloud, "ui_LuckyBox", "bg_cloud");
|
|
|
+
|
|
|
+ // 等待所有背景特效加载完成
|
|
|
+ while (_effectUI1.GetObj() == null || _effectUI2.GetObj() == null ||
|
|
|
+ _effectUI3.GetObj() == null)
|
|
|
+ {
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ onComplete?.Invoke();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SetupViewAfterEffectsLoaded()
|
|
|
+ {
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
|
|
|
if (_rewardList.Count == 1)
|
|
|
{
|
|
|
@@ -166,7 +184,8 @@ namespace GFGGame
|
|
|
UpdateItem(_ui.target.GetChild("item" + i).asCom, i, 10);
|
|
|
}
|
|
|
}
|
|
|
- //修改,因为加了抽奖动画,在进入后就直接筛选掉所有不是新的
|
|
|
+
|
|
|
+ // 修改,因为加了抽奖动画,在进入后就直接筛选掉所有不是新的
|
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
|
{
|
|
|
UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[i]);
|
|
|
@@ -175,38 +194,38 @@ namespace GFGGame
|
|
|
_recordTurnIndex.Add(i);
|
|
|
_recordOpenIndex.Add(i);
|
|
|
}
|
|
|
+
|
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
- if(GetSuitItemController.isAuto)
|
|
|
+
|
|
|
+ if (GetSuitItemController.isAuto)
|
|
|
{
|
|
|
OnClickBtnPass();
|
|
|
}
|
|
|
- Timers.inst.Add(0.5f, 1, UpDataTimeTouchLoaBg);
|
|
|
+
|
|
|
+ Timers.inst.Add(0.5f, 1, UpDataTimeTouchLoaBg);
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
_rewardList.Clear();
|
|
|
-
|
|
|
base.OnHide();
|
|
|
+
|
|
|
Timers.inst.Remove(UpDataTime);
|
|
|
Timers.inst.Remove(UpClickDataTime);
|
|
|
Timers.inst.Remove(touchFlipOpen);
|
|
|
Timers.inst.Remove(UpDataTimeTouchLoaBg);
|
|
|
+
|
|
|
GetSuitItemController.isAuto = false;
|
|
|
_touchLoaBg = true;
|
|
|
|
|
|
- foreach (var v in _effectUIDic)
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(v.Value);
|
|
|
- }
|
|
|
-
|
|
|
- _effectUIDic.Clear();
|
|
|
EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_BONUS_VIEW_CLOSE);
|
|
|
}
|
|
|
|
|
|
private void UpdateItem(GComponent com, int index, int countType)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(com);
|
|
|
ItemData itemData = _rewardList[index];
|
|
|
ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(itemData.id);
|
|
|
@@ -219,63 +238,20 @@ namespace GFGGame
|
|
|
// 圆盘出现时等待玩家点击的特效
|
|
|
switch (itemCfg.Rarity)
|
|
|
{
|
|
|
- case 1:
|
|
|
-
|
|
|
- break;
|
|
|
- case 2:
|
|
|
-
|
|
|
- break;
|
|
|
case 3:
|
|
|
- _effectUIDic.Add("CK_Loop_Wait_Chen" + index, EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_Chen"));
|
|
|
+ _effectUIDic.Add("CK_Loop_Wait_Chen" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_Chen"));
|
|
|
break;
|
|
|
case 4:
|
|
|
- _effectUIDic.Add("CK_Loop_Wait_GS" + index, EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_GS"));
|
|
|
+ _effectUIDic.Add("CK_Loop_Wait_GS" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_GS"));
|
|
|
break;
|
|
|
case 5:
|
|
|
- _effectUIDic.Add("CK_Loop_Wait_Jin" + index, EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_Jin"));
|
|
|
+ _effectUIDic.Add("CK_Loop_Wait_Jin" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_waitClick_eff, "ui_LuckyBox", "CK_Loop_Wait_Jin"));
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- //带特效的处理先注释
|
|
|
- //item.m_comIcon.m_holder.visible = false;
|
|
|
- //item.m_comIcon.m_holder1.visible = false;
|
|
|
- //if (itemCfg.rarity > 2) {
|
|
|
- // string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
|
|
|
- // GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
|
|
|
- // holder.visible = true;
|
|
|
- // if (countType == 10 && (!_effListTen.ContainsKey(index) ||
|
|
|
- // ((itemCfg.rarity == 3 && !_effListTen[index].ContainsKey(0)) || (itemCfg.rarity == 4 && !_effListTen[index].ContainsKey(1)))))
|
|
|
- // {
|
|
|
- // EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
-
|
|
|
- // if (!_effListTen.ContainsKey(index))
|
|
|
- // {
|
|
|
- // Dictionary<int, EffectUI> effectList = new Dictionary<int, EffectUI>();
|
|
|
- // if (itemCfg.rarity == 3)
|
|
|
- // effectList.Add(0, _effectUI);
|
|
|
- // else if (itemCfg.rarity == 4)
|
|
|
- // effectList.Add(1, _effectUI);
|
|
|
- // _effListTen.Add(index, effectList);
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // if (itemCfg.rarity == 3)
|
|
|
- // _effListTen[index].Add(0, _effectUI);
|
|
|
- // else if (itemCfg.rarity == 4)
|
|
|
- // _effListTen[index].Add(1, _effectUI);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (countType == 1 &&
|
|
|
- // ((itemCfg.rarity == 3 && !_effList.ContainsKey(0)) || (itemCfg.rarity == 4 && !_effList.ContainsKey(1))))
|
|
|
- // {
|
|
|
- // EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
- // if (itemCfg.rarity == 3)
|
|
|
- // _effList.Add(0, _effectUI);
|
|
|
- // else if (itemCfg.rarity == 4)
|
|
|
- // _effList.Add(1, _effectUI);
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
int count = 0;
|
|
|
bool isFirst = false;
|
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
|
@@ -283,16 +259,19 @@ namespace GFGGame
|
|
|
if (_rewardList[i].id == itemData.id) count++;
|
|
|
if (count == 1 && i == index) isFirst = true;
|
|
|
}
|
|
|
+
|
|
|
item.m_comIcon.m_imgNew.visible = count == ItemDataManager.GetItemNum(itemData.id) && isFirst;
|
|
|
if (_itemHasNew.ContainsKey(index))
|
|
|
_itemHasNew[index] = item.m_comIcon.m_imgNew.visible;
|
|
|
else
|
|
|
_itemHasNew.Add(index, item.m_comIcon.m_imgNew.visible);
|
|
|
+
|
|
|
item.m_t0.Play();
|
|
|
if (item.target.data == null)
|
|
|
{
|
|
|
item.target.onClick.Add(ShowItemTips);
|
|
|
}
|
|
|
+
|
|
|
item.target.data = index;
|
|
|
|
|
|
_itemIdList.Add(index, itemCfg.Id);
|
|
|
@@ -303,10 +282,8 @@ namespace GFGGame
|
|
|
|
|
|
private void ShowItemTips(EventContext context)
|
|
|
{
|
|
|
- if (!_touchLoaBg)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (!_allEffectsLoaded || !_touchLoaBg) return;
|
|
|
+
|
|
|
_touchLoaBg = false;
|
|
|
Timers.inst.Add(0.5f, 1, UpDataTimeTouchLoaBg);
|
|
|
|
|
|
@@ -314,11 +291,12 @@ namespace GFGGame
|
|
|
int index = (int)obj.data;
|
|
|
_chooseIndex = index;
|
|
|
GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
|
|
|
- //HandClickItem(index);
|
|
|
}
|
|
|
|
|
|
private void HandClickItem(int index)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
|
_handClick = true;
|
|
|
ClickItem(index);
|
|
|
@@ -328,6 +306,8 @@ namespace GFGGame
|
|
|
|
|
|
private void UpClickDataTime(object param = null)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
int index = (int)param;
|
|
|
Timers.inst.Remove(UpClickDataTime);
|
|
|
if (_recordTurnIndex.Contains(index) && _recordOpenIndex.Contains(index))
|
|
|
@@ -341,6 +321,8 @@ namespace GFGGame
|
|
|
|
|
|
void ClickItem(int index)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
if (_recordOpenIndex.Count >= _rewardList.Count)
|
|
|
_ui.m_BtnPass.visible = false;
|
|
|
|
|
|
@@ -364,12 +346,11 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickLoaBg(EventContext context)
|
|
|
{
|
|
|
- if (!_touchLoaBg)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (!_allEffectsLoaded || !_touchLoaBg) return;
|
|
|
+
|
|
|
_touchLoaBg = false;
|
|
|
Timers.inst.Add(0.5f, 1, UpDataTimeTouchLoaBg);
|
|
|
+
|
|
|
if (_recordOpenIndex.Count >= _rewardList.Count)
|
|
|
{
|
|
|
_chooseIndex = -1;
|
|
|
@@ -391,6 +372,8 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnPass()
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
for (int index = 0; index < _rewardList.Count; index++)
|
|
|
{
|
|
|
if (!_recordOpenIndex.Contains(index))
|
|
|
@@ -402,6 +385,7 @@ namespace GFGGame
|
|
|
if (_rewardList[i].id == _rewardList[index].id) count++;
|
|
|
if (count == 1 && i == index) isFirst = true;
|
|
|
}
|
|
|
+
|
|
|
bool open = count == ItemDataManager.GetItemNum(_rewardList[index].id) && isFirst;
|
|
|
|
|
|
if (!open)
|
|
|
@@ -411,24 +395,31 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
ClickPass();
|
|
|
}
|
|
|
|
|
|
private void ClickPass()
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
GetSuitItemController.isAuto = true;
|
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
|
_ui.m_BtnPass.visible = false;
|
|
|
+
|
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
|
{
|
|
|
TurnItem(i);
|
|
|
}
|
|
|
+
|
|
|
//展示获得物品
|
|
|
Timers.inst.Add(LuckyBoxDataManager.ANIMATION_TIME, 0, UpDataTime);
|
|
|
}
|
|
|
|
|
|
private void UpDataTime(object param = null)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded) return;
|
|
|
+
|
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
|
if (_recordTurnIndex.Count >= _rewardList.Count)
|
|
|
{
|
|
|
@@ -448,92 +439,178 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //控制展示获得物品界面
|
|
|
private void ShowTurnItem(int index)
|
|
|
{
|
|
|
+ if (!_allEffectsLoaded || !_AnimationWait) return;
|
|
|
+
|
|
|
UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
- if (!_AnimationWait)
|
|
|
+ if (!item.m_comIcon.m_imgNew.visible)
|
|
|
+ {
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
+ _countShow += 1;
|
|
|
+ //判断是否有套装需要展示
|
|
|
+ int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[index]);
|
|
|
+ ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_itemIdList[index]);
|
|
|
|
|
|
- if (item.m_comIcon.m_imgNew.visible)
|
|
|
+ if (suitId > 0 && itemCfg.ItemType != ConstItemType.CARD)
|
|
|
{
|
|
|
- _countShow += 1;
|
|
|
- //判断是否有套装需要展示
|
|
|
- int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[index]);
|
|
|
- ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_itemIdList[index]);
|
|
|
- if (suitId > 0 && itemCfg.ItemType != ConstItemType.CARD)
|
|
|
+ if (_countShow == 1)
|
|
|
{
|
|
|
- if (_countShow == 1)
|
|
|
- {
|
|
|
- ViewManager.Hide<SuitItemView>();
|
|
|
- ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
- ViewManager.Hide<GetSuitItemVIew>();
|
|
|
- _rewardItemList.Clear();
|
|
|
- _rewardItemList.Add(_rewardList[index]);
|
|
|
- ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
- }
|
|
|
- else
|
|
|
+ ViewManager.Hide<SuitItemView>();
|
|
|
+ ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
+ ViewManager.Hide<GetSuitItemVIew>();
|
|
|
+ _rewardItemList.Clear();
|
|
|
+ _rewardItemList.Add(_rewardList[index]);
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ViewManager.Hide<LuckyBoxNewDressView>();
|
|
|
+ ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
+ int count = 0;
|
|
|
+ int totalCount = 0;
|
|
|
+ DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitId, out count, out totalCount);
|
|
|
+
|
|
|
+ if (_countShow == 2) //展示进度条界面
|
|
|
{
|
|
|
- ViewManager.Hide<LuckyBoxNewDressView>();
|
|
|
- ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
- int count = 0;
|
|
|
- int totalCount = 0;
|
|
|
- DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitId, out count, out totalCount);
|
|
|
- if (_countShow == 2) //展示进度条界面
|
|
|
+ int countSuitId = 0;
|
|
|
+ for (int i = index + 1; i < _rewardList.Count; i++)
|
|
|
{
|
|
|
- int countSuitId = 0;
|
|
|
- for (int i = index + 1; i < _rewardList.Count; i++)
|
|
|
+ _itemHasNew.TryGetValue(i, out bool isNew);
|
|
|
+ var itemRewardCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_rewardList[i].id);
|
|
|
+ if (isNew && itemRewardCfg.ItemType == ConstItemType.DRESS_UP &&
|
|
|
+ itemRewardCfg.SuitId == suitId)
|
|
|
{
|
|
|
- _itemHasNew.TryGetValue(i, out bool isNew);
|
|
|
- var itemRewardCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_rewardList[i].id);
|
|
|
- if (isNew && itemRewardCfg.ItemType == ConstItemType.DRESS_UP && itemRewardCfg.SuitId == suitId) {
|
|
|
- countSuitId++;
|
|
|
- }
|
|
|
-
|
|
|
+ countSuitId++;
|
|
|
}
|
|
|
- count = count - countSuitId;
|
|
|
- ViewManager.Show<SuitItemView>(new object[] { suitId, countSuitId });
|
|
|
- }
|
|
|
- else if (_countShow == 3) //展示集齐套装界面
|
|
|
- {
|
|
|
- ViewManager.Hide<SuitItemView>();
|
|
|
- ViewManager.Show<GetSuitItemVIew>(suitId);
|
|
|
- _AnimationWait = false;
|
|
|
}
|
|
|
|
|
|
- //判断是否需要显示集齐套装界面(需要的时候晚3个定时器时间)
|
|
|
- if (count <= 0 || totalCount <= 0 || count < totalCount || (count >= totalCount && _countShow > 5))
|
|
|
+ count = count - countSuitId;
|
|
|
+ ViewManager.Show<SuitItemView>(new object[] { suitId, countSuitId });
|
|
|
+ }
|
|
|
+ else if (_countShow == 3) //展示集齐套装界面
|
|
|
+ {
|
|
|
+ ViewManager.Hide<SuitItemView>();
|
|
|
+ ViewManager.Show<GetSuitItemVIew>(suitId);
|
|
|
+ _AnimationWait = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断是否需要显示集齐套装界面(需要的时候晚3个定时器时间)
|
|
|
+ if (count <= 0 || totalCount <= 0 || count < totalCount || (count >= totalCount && _countShow > 5))
|
|
|
+ {
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ _countShow = 0;
|
|
|
+ if (_handClick)
|
|
|
{
|
|
|
- _recordTurnIndex.Add(index);
|
|
|
- _countShow = 0;
|
|
|
- if (_handClick)
|
|
|
- {
|
|
|
- _handClick = false;
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
- }
|
|
|
+ _handClick = false;
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //词牌和不是套装进这里
|
|
|
- ViewManager.Hide<SuitItemView>();
|
|
|
- ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
- ViewManager.Hide<GetSuitItemVIew>();
|
|
|
- _rewardItemList.Clear();
|
|
|
- _rewardItemList.Add(_rewardList[index]);
|
|
|
- ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
- _recordTurnIndex.Add(index);
|
|
|
- _countShow = 0;
|
|
|
- Timers.inst.Add(1.5f, 1, touchFlipOpen); //防止点击太快
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ //词牌和不是套装进这里
|
|
|
+ ViewManager.Hide<SuitItemView>();
|
|
|
+ ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
+ ViewManager.Hide<GetSuitItemVIew>();
|
|
|
+ _rewardItemList.Clear();
|
|
|
+ _rewardItemList.Add(_rewardList[index]);
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
_recordTurnIndex.Add(index);
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ _countShow = 0;
|
|
|
+ Timers.inst.Add(1.5f, 1, touchFlipOpen); //防止点击太快
|
|
|
}
|
|
|
+
|
|
|
+ UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void TurnItem(int index)
|
|
|
+ {
|
|
|
+ if (!_allEffectsLoaded || _recordOpenIndex.Contains(index)) return;
|
|
|
+
|
|
|
+ // 删除 "等待翻开" 的特效
|
|
|
+ if (_effectUIDic.ContainsKey("CK_Loop_Wait_Chen" + index))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_Chen" + index]);
|
|
|
+ _effectUIDic.Remove("CK_Loop_Wait_Chen" + index);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_effectUIDic.ContainsKey("CK_Loop_Wait_GS" + index))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_GS" + index]);
|
|
|
+ _effectUIDic.Remove("CK_Loop_Wait_GS" + index);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_effectUIDic.ContainsKey("CK_Loop_Wait_Jin" + index))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_Jin" + index]);
|
|
|
+ _effectUIDic.Remove("CK_Loop_Wait_Jin" + index);
|
|
|
+ }
|
|
|
+
|
|
|
+ UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
+ if (!item.m_comIcon.m_imgNew.visible && !_recordTurnIndex.Contains(index))
|
|
|
+ {
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_itemIdList[index]);
|
|
|
+
|
|
|
+ // 点击特效
|
|
|
+ if (!_effectUIDic.ContainsKey("CK_Cirle_DJ" + index))
|
|
|
+ {
|
|
|
+ _effectUIDic.Add("CK_Cirle_DJ" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_click_eff, "ui_LuckyBox", "CK_Cirle_DJ"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _effectUIDic["CK_Cirle_DJ" + index] =
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_click_eff, "ui_LuckyBox", "CK_Cirle_DJ");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 翻开特效
|
|
|
+ switch (itemCfg.Rarity)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_LanHui_UI" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_HuiLan_UI"));
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_LanHui_TX" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox",
|
|
|
+ "CK_OpenAfter_LanHui_TX"));
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_LanHui_UI" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_LanHui_UI"));
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_LanHui_TX" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox",
|
|
|
+ "CK_OpenAfter_LanHui_TX"));
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_Chen_UI" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_Chen_UI"));
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_Chen_TX" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_Chen_TX"));
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_GS_UI" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_GS_UI"));
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_GS_TX" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_GS_TX"));
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_Jin_UI" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_Jin_UI"));
|
|
|
+ _effectUIDic.Add("CK_OpenAfter_Jin_TX" + index,
|
|
|
+ EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_Jin_TX"));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ _recordOpenIndex.Add(index);
|
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
@@ -543,88 +620,35 @@ namespace GFGGame
|
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
|
}
|
|
|
|
|
|
- private void TurnItem(int index)
|
|
|
+ protected void OthershowViewClose()
|
|
|
{
|
|
|
- if (!_recordOpenIndex.Contains(index))
|
|
|
- {
|
|
|
- // 删除 “等待翻开” 的特效
|
|
|
- if (_effectUIDic.ContainsKey("CK_Loop_Wait_Chen" + index))
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_Chen" + index]);
|
|
|
- _effectUIDic.Remove("CK_Loop_Wait_Chen" + index);
|
|
|
- }
|
|
|
- if (_effectUIDic.ContainsKey("CK_Loop_Wait_GS" + index))
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_GS" + index]);
|
|
|
- _effectUIDic.Remove("CK_Loop_Wait_GS" + index);
|
|
|
- }
|
|
|
- if (_effectUIDic.ContainsKey("CK_Loop_Wait_Jin" + index))
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(_effectUIDic["CK_Loop_Wait_Jin" + index]);
|
|
|
- _effectUIDic.Remove("CK_Loop_Wait_Jin" + index);
|
|
|
- }
|
|
|
-
|
|
|
- UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
- if (!item.m_comIcon.m_imgNew.visible)
|
|
|
- {
|
|
|
- if(!_recordTurnIndex.Contains(index))
|
|
|
- {
|
|
|
- _recordTurnIndex.Add(index);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //先翻开牌面
|
|
|
- //item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
|
- //item.m_t1.Play();
|
|
|
- //item.m_t2.Play();
|
|
|
-
|
|
|
- ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_itemIdList[index]);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ }
|
|
|
|
|
|
- // 点击特效
|
|
|
- if (!_effectUIDic.ContainsKey("CK_Cirle_DJ" + index))
|
|
|
- {
|
|
|
- _effectUIDic.Add("CK_Cirle_DJ" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_click_eff, "ui_LuckyBox", "CK_Cirle_DJ"));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _effectUIDic["CK_Cirle_DJ" + index] = EffectUIPool.CreateEffectUI(item.m_comIcon.m_click_eff, "ui_LuckyBox", "CK_Cirle_DJ");
|
|
|
- }
|
|
|
- // 翻开特效
|
|
|
- switch (itemCfg.Rarity)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- _effectUIDic.Add("CK_OpenAfter_LanHui_UI" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_HuiLan_UI"));
|
|
|
- _effectUIDic.Add("CK_OpenAfter_LanHui_TX" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_LanHui_TX"));
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- _effectUIDic.Add("CK_OpenAfter_LanHui_UI" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_LanHui_UI"));
|
|
|
- _effectUIDic.Add("CK_OpenAfter_LanHui_TX" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_LanHui_TX"));
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- _effectUIDic.Add("CK_OpenAfter_Chen_UI" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_Chen_UI"));
|
|
|
- _effectUIDic.Add("CK_OpenAfter_Chen_TX" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_Chen_TX"));
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- _effectUIDic.Add("CK_OpenAfter_GS_UI" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_GS_UI"));
|
|
|
- _effectUIDic.Add("CK_OpenAfter_GS_TX" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_GS_TX"));
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- _effectUIDic.Add("CK_OpenAfter_Jin_UI" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_ui_eff, "ui_LuckyBox", "CK_OpenAfter_Jin_UI"));
|
|
|
- _effectUIDic.Add("CK_OpenAfter_Jin_TX" + index, EffectUIPool.CreateEffectUI(item.m_comIcon.m_flip_eff, "ui_LuckyBox", "CK_OpenAfter_Jin_TX"));
|
|
|
- break;
|
|
|
- }
|
|
|
+ protected void ReferNextShow()
|
|
|
+ {
|
|
|
+ if (!_allEffectsLoaded || GetSuitItemController.isAuto) return;
|
|
|
|
|
|
+ int suitId = 0;
|
|
|
+ if (_itemIdList.ContainsKey(_chooseIndex))
|
|
|
+ suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[_chooseIndex]);
|
|
|
|
|
|
- //item.m_comIcon.m_t0.Play();
|
|
|
- if(!_recordOpenIndex.Contains(index))
|
|
|
+ if (_chooseIndex != -1 && suitId > 0)
|
|
|
+ ClickItem(_chooseIndex);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_handClick)
|
|
|
{
|
|
|
- _recordOpenIndex.Add(index);
|
|
|
+ _handClick = false;
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
}
|
|
|
- UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected void SetAnimationWait()
|
|
|
+ {
|
|
|
+ _AnimationWait = true;
|
|
|
+ }
|
|
|
|
|
|
private void HideOtherShowWindow()
|
|
|
{
|
|
|
@@ -633,10 +657,5 @@ namespace GFGGame
|
|
|
ViewManager.Hide<LuckyBoxNewDressView>();
|
|
|
ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
}
|
|
|
-
|
|
|
- private void SetAnimationWait()
|
|
|
- {
|
|
|
- _AnimationWait = true;
|
|
|
- }
|
|
|
}
|
|
|
}
|