|
@@ -11,22 +11,23 @@ namespace GFGGame
|
|
private UI_LuckBoxBonusShowUI _ui;
|
|
private UI_LuckBoxBonusShowUI _ui;
|
|
private List<ItemData> _rewardList = new List<ItemData>();
|
|
private List<ItemData> _rewardList = new List<ItemData>();
|
|
private List<ItemData> _rewardItemList = 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, EffectUI> _effList = new Dictionary<int, EffectUI>();
|
|
|
|
|
|
private Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
|
|
private Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
|
|
private Dictionary<int, GComponent> _itemObjList = new Dictionary<int, GComponent>();
|
|
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 int _countNewRecord = 0; //展示步骤
|
|
|
|
- private bool _handClick = false; //手动点击开启
|
|
|
|
- private bool _AnimationWait = true; //抽卡动画等待加载完毕
|
|
|
|
|
|
+ private List<int> _recordOpenIndex = new List<int>(); //璁板綍鎵撳紑杩囧緱item浣嶇疆
|
|
|
|
+ private List<int> _recordTurnIndex = new List<int>(); //璁板綍鎾�斁杩噄tem浣嶇疆
|
|
|
|
+ private int _chooseIndex = -1; //褰撳墠閫変腑鐨刬ndex
|
|
|
|
+ private int _countShow = 0; //绗�嚑娆″睍绀�
|
|
|
|
+ private int _countNewRecord = 0; //灞曠ず姝ラ�
|
|
|
|
+ private bool _handClick = false; //鎵嬪姩鐐瑰嚮寮€鍚�
|
|
|
|
+ private bool _AnimationWait = true; //鎶藉崱鍔ㄧ敾绛夊緟鍔犺浇瀹屾瘯
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
private EffectUI _effectUI1;
|
|
private EffectUI _effectUI2;
|
|
private EffectUI _effectUI2;
|
|
private EffectUI _effectUI3;
|
|
private EffectUI _effectUI3;
|
|
|
|
+ private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
@@ -37,7 +38,8 @@ namespace GFGGame
|
|
EffectUIPool.Recycle(_effectUI3);
|
|
EffectUIPool.Recycle(_effectUI3);
|
|
_effectUI3 = null;
|
|
_effectUI3 = null;
|
|
|
|
|
|
- for (int key = 0; key < _effListTen.Count; key++) {
|
|
|
|
|
|
+ for (int key = 0; key < _effListTen.Count; key++)
|
|
|
|
+ {
|
|
if (_effListTen.ContainsKey(key))
|
|
if (_effListTen.ContainsKey(key))
|
|
{
|
|
{
|
|
for (int key1 = 0; key1 < _effListTen[key].Count; key1++)
|
|
for (int key1 = 0; key1 < _effListTen[key].Count; key1++)
|
|
@@ -82,7 +84,7 @@ namespace GFGGame
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
|
|
|
_ui.m_BtnPass.onClick.Add(OnClickBtnPass);
|
|
_ui.m_BtnPass.onClick.Add(OnClickBtnPass);
|
|
-
|
|
|
|
|
|
+
|
|
UpdateEffect();
|
|
UpdateEffect();
|
|
}
|
|
}
|
|
private void UpdateEffect()
|
|
private void UpdateEffect()
|
|
@@ -110,7 +112,8 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (_chooseIndex != -1 && GetSuitItemController.GetSuitWaitingToId(_itemIdList[_chooseIndex]))
|
|
if (_chooseIndex != -1 && GetSuitItemController.GetSuitWaitingToId(_itemIdList[_chooseIndex]))
|
|
ClickItem(_chooseIndex);
|
|
ClickItem(_chooseIndex);
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
if (_handClick)
|
|
if (_handClick)
|
|
{
|
|
{
|
|
_handClick = false;
|
|
_handClick = false;
|
|
@@ -153,6 +156,13 @@ namespace GFGGame
|
|
base.OnHide();
|
|
base.OnHide();
|
|
Timers.inst.Remove(UpDataTime);
|
|
Timers.inst.Remove(UpDataTime);
|
|
Timers.inst.Remove(UpClickDataTime);
|
|
Timers.inst.Remove(UpClickDataTime);
|
|
|
|
+
|
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
|
+ {
|
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ _effectUIDic.Clear();
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateItem(GComponent com, int index, int countType)
|
|
private void UpdateItem(GComponent com, int index, int countType)
|
|
@@ -166,7 +176,24 @@ namespace GFGGame
|
|
item.m_comIcon.m_FlipOpenType.selectedIndex = 1;
|
|
item.m_comIcon.m_FlipOpenType.selectedIndex = 1;
|
|
item.m_comIcon.m_t1.Play();
|
|
item.m_comIcon.m_t1.Play();
|
|
|
|
|
|
- //带特效的处理先注释
|
|
|
|
|
|
+ // 鍦嗙洏鍑虹幇鏃剁瓑寰呯帺瀹剁偣鍑荤殑鐗规晥
|
|
|
|
+ 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"));
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ _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_holder.visible = false;
|
|
//item.m_comIcon.m_holder1.visible = false;
|
|
//item.m_comIcon.m_holder1.visible = false;
|
|
//if (itemCfg.rarity > 2) {
|
|
//if (itemCfg.rarity > 2) {
|
|
@@ -221,7 +248,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
item.target.data = index;
|
|
item.target.data = index;
|
|
|
|
|
|
- _itemIdList.Add(index,itemCfg.id);
|
|
|
|
|
|
+ _itemIdList.Add(index, itemCfg.id);
|
|
_itemObjList.Add(index, com);
|
|
_itemObjList.Add(index, com);
|
|
|
|
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
@@ -240,7 +267,7 @@ namespace GFGGame
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
_handClick = true;
|
|
_handClick = true;
|
|
ClickItem(index);
|
|
ClickItem(index);
|
|
- Timers.inst.Add(1f, 1, UpClickDataTime,index);
|
|
|
|
|
|
+ Timers.inst.Add(1f, 1, UpClickDataTime, index);
|
|
}
|
|
}
|
|
|
|
|
|
private void UpClickDataTime(object param = null)
|
|
private void UpClickDataTime(object param = null)
|
|
@@ -263,7 +290,8 @@ namespace GFGGame
|
|
|
|
|
|
if (!_recordOpenIndex.Contains(index))
|
|
if (!_recordOpenIndex.Contains(index))
|
|
TurnItem(index);
|
|
TurnItem(index);
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
if (!_recordTurnIndex.Contains(index))
|
|
if (!_recordTurnIndex.Contains(index))
|
|
ShowTurnItem(index);
|
|
ShowTurnItem(index);
|
|
else
|
|
else
|
|
@@ -278,7 +306,8 @@ namespace GFGGame
|
|
_chooseIndex = -1;
|
|
_chooseIndex = -1;
|
|
this.Hide();
|
|
this.Hide();
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
for (int index = 0; index < _rewardList.Count; index++)
|
|
for (int index = 0; index < _rewardList.Count; index++)
|
|
{
|
|
{
|
|
if (!_recordOpenIndex.Contains(index))
|
|
if (!_recordOpenIndex.Contains(index))
|
|
@@ -332,7 +361,8 @@ namespace GFGGame
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
{
|
|
{
|
|
- if (!_recordTurnIndex.Contains(i)) {
|
|
|
|
|
|
+ if (!_recordTurnIndex.Contains(i))
|
|
|
|
+ {
|
|
ShowTurnItem(i);
|
|
ShowTurnItem(i);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -354,7 +384,7 @@ namespace GFGGame
|
|
|
|
|
|
if (item.m_comIcon.m_imgNew.visible)
|
|
if (item.m_comIcon.m_imgNew.visible)
|
|
{
|
|
{
|
|
- //判断是否有套装需要展示
|
|
|
|
|
|
+ //鍒ゆ柇鏄�惁鏈夊�瑁呴渶瑕佸睍绀�
|
|
if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
|
|
if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
|
|
{
|
|
{
|
|
if (_countShow < 1)
|
|
if (_countShow < 1)
|
|
@@ -365,7 +395,7 @@ namespace GFGGame
|
|
_rewardItemList.Add(_rewardList[index]);
|
|
_rewardItemList.Add(_rewardList[index]);
|
|
ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ else
|
|
{
|
|
{
|
|
ViewManager.Hide<LuckyBoxNewDressView>();
|
|
ViewManager.Hide<LuckyBoxNewDressView>();
|
|
ViewManager.Hide<LuckyBoxNewCardView>();
|
|
ViewManager.Hide<LuckyBoxNewCardView>();
|
|
@@ -392,25 +422,67 @@ namespace GFGGame
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
_recordTurnIndex.Add(index);
|
|
_recordTurnIndex.Add(index);
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
}
|
|
}
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void TurnItem(int index)
|
|
private void TurnItem(int index)
|
|
{
|
|
{
|
|
if (!_recordOpenIndex.Contains(index))
|
|
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_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]);
|
|
UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
if (!item.m_comIcon.m_imgNew.visible)
|
|
if (!item.m_comIcon.m_imgNew.visible)
|
|
_recordTurnIndex.Add(index);
|
|
_recordTurnIndex.Add(index);
|
|
|
|
|
|
- //先翻开牌面
|
|
|
|
|
|
+ //鍏堢炕寮€鐗岄潰
|
|
item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
//item.m_t1.Play();
|
|
//item.m_t1.Play();
|
|
item.m_t2.Play();
|
|
item.m_t2.Play();
|
|
|
|
+
|
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemIdList[index]);
|
|
|
|
+
|
|
|
|
+ // 鐐瑰嚮鐗规晥
|
|
|
|
+ _effectUIDic.Add("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_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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
item.m_comIcon.m_t0.Play();
|
|
item.m_comIcon.m_t0.Play();
|
|
_recordOpenIndex.Add(index);
|
|
_recordOpenIndex.Add(index);
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|