|
@@ -17,6 +17,7 @@ namespace GFGGame
|
|
|
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 int _countNewRecord = 0; //展示步骤
|
|
@@ -123,6 +124,7 @@ namespace GFGGame
|
|
|
_itemIdList.Clear();
|
|
|
_itemObjList.Clear();
|
|
|
_recordOpenIndex.Clear();
|
|
|
+ _recordTurnIndex.Clear();
|
|
|
_ui.m_BtnPass.visible = true;
|
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
|
|
|
@@ -238,76 +240,31 @@ namespace GFGGame
|
|
|
Timers.inst.Add(1f, 1, UpClickDataTime,index);
|
|
|
}
|
|
|
|
|
|
- void ClickItem(int index)
|
|
|
+ private void UpClickDataTime(object param = null)
|
|
|
{
|
|
|
- if (!_recordOpenIndex.Contains(index))
|
|
|
+ int index = (int)param;
|
|
|
+ if (_recordTurnIndex.Contains(index) && _recordOpenIndex.Contains(index))
|
|
|
{
|
|
|
- UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
- if (_recordOpenIndex.Count >= _rewardList.Count - 1)
|
|
|
- _ui.m_BtnPass.visible = false;
|
|
|
-
|
|
|
- //先翻开牌面
|
|
|
- if (!item.m_comIcon.m_imgNew.visible || _countNewRecord < 1)
|
|
|
- {
|
|
|
- HideOtherShowWindow();
|
|
|
- item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
|
- //item.m_t1.Play();
|
|
|
- item.m_t2.Play();
|
|
|
- item.m_comIcon.m_t0.Play();
|
|
|
-
|
|
|
- if (!item.m_comIcon.m_imgNew.visible) {
|
|
|
- _recordOpenIndex.Add(index);
|
|
|
- }
|
|
|
- else if (_countNewRecord < 1)
|
|
|
- _countNewRecord += 1;
|
|
|
+ Timers.inst.Remove(UpClickDataTime);
|
|
|
+ HideOtherShowWindow();
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ ClickItem(index);
|
|
|
+ }
|
|
|
|
|
|
- return;
|
|
|
- }
|
|
|
+ void ClickItem(int index)
|
|
|
+ {
|
|
|
+ if (_recordOpenIndex.Count >= _rewardList.Count)
|
|
|
+ _ui.m_BtnPass.visible = false;
|
|
|
|
|
|
- if (item.m_comIcon.m_imgNew.visible && _countNewRecord >= 1)
|
|
|
- {
|
|
|
- //判断是否有套装需要展示
|
|
|
- if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
|
|
|
- {
|
|
|
- if (_countShow < 1)
|
|
|
- {
|
|
|
- _countShow += 1;
|
|
|
- ViewManager.Hide<GetSuitItemVIew>();
|
|
|
- _rewardItemList.Clear();
|
|
|
- _rewardItemList.Add(_rewardList[index]);
|
|
|
- ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ViewManager.Hide<LuckyBoxNewDressView>();
|
|
|
- ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
- GetSuitItemController.TryShow(_itemIdList[index]);
|
|
|
- _recordOpenIndex.Add(index);
|
|
|
- _countShow = 0;
|
|
|
- _countNewRecord = 0;
|
|
|
-
|
|
|
- if (_handClick)
|
|
|
- {
|
|
|
- _handClick = false;
|
|
|
- Timers.inst.Remove(UpClickDataTime);
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ViewManager.Hide<GetSuitItemVIew>();
|
|
|
- _rewardItemList.Clear();
|
|
|
- _rewardItemList.Add(_rewardList[index]);
|
|
|
- ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
- _recordOpenIndex.Add(index);
|
|
|
- _countNewRecord = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
- }
|
|
|
- else{
|
|
|
- GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
|
|
|
+ if (!_recordOpenIndex.Contains(index))
|
|
|
+ TurnItem(index);
|
|
|
+ else {
|
|
|
+ if (!_recordTurnIndex.Contains(index))
|
|
|
+ ShowTurnItem(index);
|
|
|
+ else
|
|
|
+ GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -359,39 +316,102 @@ namespace GFGGame
|
|
|
private void ClickPass()
|
|
|
{
|
|
|
_ui.m_touchFlipOpen.touchable = true;
|
|
|
+ _ui.m_BtnPass.visible = false;
|
|
|
+ for (int i = 0; i < _rewardList.Count; i++)
|
|
|
+ {
|
|
|
+ TurnItem(i);
|
|
|
+ }
|
|
|
Timers.inst.Add(1f, 0, UpDataTime);
|
|
|
}
|
|
|
|
|
|
private void UpDataTime(object param = null)
|
|
|
{
|
|
|
- if (_recordOpenIndex.Count >= _rewardList.Count) {
|
|
|
+ _ui.m_touchFlipOpen.touchable = true;
|
|
|
+ for (int i = 0; i < _rewardList.Count; i++)
|
|
|
+ {
|
|
|
+ if (!_recordTurnIndex.Contains(i)) {
|
|
|
+ ShowTurnItem(i);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_recordTurnIndex.Count >= _rewardList.Count)
|
|
|
+ {
|
|
|
Timers.inst.Remove(UpDataTime);
|
|
|
HideOtherShowWindow();
|
|
|
_ui.m_touchFlipOpen.touchable = false;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (int i = 0; i < _rewardList.Count; i++)
|
|
|
+ private void ShowTurnItem(int index)
|
|
|
+ {
|
|
|
+ UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
+
|
|
|
+ if (item.m_comIcon.m_imgNew.visible)
|
|
|
{
|
|
|
- if (!_recordOpenIndex.Contains(i)) {
|
|
|
- ClickItem(i);
|
|
|
- break;
|
|
|
+ //判断是否有套装需要展示
|
|
|
+ if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
|
|
|
+ {
|
|
|
+ if (_countShow < 1)
|
|
|
+ {
|
|
|
+ _countShow += 1;
|
|
|
+ ViewManager.Hide<GetSuitItemVIew>();
|
|
|
+ _rewardItemList.Clear();
|
|
|
+ _rewardItemList.Add(_rewardList[index]);
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ViewManager.Hide<LuckyBoxNewDressView>();
|
|
|
+ ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
+ GetSuitItemController.TryShow(_itemIdList[index]);
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ _countShow = 0;
|
|
|
+
|
|
|
+ if (_handClick)
|
|
|
+ {
|
|
|
+ _handClick = false;
|
|
|
+ Timers.inst.Remove(UpClickDataTime);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ViewManager.Hide<GetSuitItemVIew>();
|
|
|
+ _rewardItemList.Clear();
|
|
|
+ _rewardItemList.Add(_rewardList[index]);
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ }
|
|
|
+ UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
-
|
|
|
- private void UpClickDataTime(object param = null)
|
|
|
+
|
|
|
+ private void TurnItem(int index)
|
|
|
{
|
|
|
- int index = (int)param;
|
|
|
- if (_recordOpenIndex.Contains(index))
|
|
|
+ if (!_recordOpenIndex.Contains(index))
|
|
|
{
|
|
|
- Timers.inst.Remove(UpClickDataTime);
|
|
|
- HideOtherShowWindow();
|
|
|
- _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
+ if (!item.m_comIcon.m_imgNew.visible)
|
|
|
+ _recordTurnIndex.Add(index);
|
|
|
+
|
|
|
+ //先翻开牌面
|
|
|
+ item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
|
+ //item.m_t1.Play();
|
|
|
+ item.m_t2.Play();
|
|
|
+ item.m_comIcon.m_t0.Play();
|
|
|
+ _recordOpenIndex.Add(index);
|
|
|
+ UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
- else
|
|
|
- ClickItem(index);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void HideOtherShowWindow()
|
|
|
{
|
|
|
ViewManager.Hide<GetSuitItemVIew>();
|