|
@@ -14,12 +14,13 @@ namespace GFGGame
|
|
|
private Dictionary<int , Dictionary<int, EffectUI>> _effListTen = new Dictionary<int, Dictionary<int, EffectUI>>();
|
|
|
private Dictionary<int, EffectUI> _effList = new Dictionary<int, EffectUI>();
|
|
|
|
|
|
- Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
|
|
|
- Dictionary<int, GComponent> _itemObjList = new Dictionary<int, GComponent>();
|
|
|
- List<int> _recordOpenIndex = new List<int>(); //记录打开过得item位置
|
|
|
+ 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 int _chooseIndex = -1; //当前选中的index
|
|
|
private int _countShow = 0; //第几次展示
|
|
|
private int _countNewRecord = 0; //展示步骤
|
|
|
- private bool touchFlipOpen = true; //禁用点击
|
|
|
+ private bool _handClick = false; //手动点击开启
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI2;
|
|
@@ -88,6 +89,25 @@ namespace GFGGame
|
|
|
_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()
|
|
|
+ {
|
|
|
+ base.AddEventListener();
|
|
|
+ EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void RemoveEventListener()
|
|
|
+ {
|
|
|
+ base.RemoveEventListener();
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void ReferNextShow()
|
|
|
+ {
|
|
|
+ if (_chooseIndex != -1)
|
|
|
+ ClickItem(_chooseIndex);
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
@@ -96,6 +116,7 @@ namespace GFGGame
|
|
|
_itemObjList.Clear();
|
|
|
_recordOpenIndex.Clear();
|
|
|
_ui.m_BtnPass.visible = true;
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
|
|
|
if (_rewardList.Count == 1)
|
|
|
{
|
|
@@ -130,6 +151,7 @@ namespace GFGGame
|
|
|
item.m_comIcon.m_txtName.text = itemCfg.name;
|
|
|
item.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
item.m_comIcon.m_FlipOpenType.selectedIndex = 1;
|
|
|
+ item.m_comIcon.m_t1.Play();
|
|
|
|
|
|
//带特效的处理先注释
|
|
|
//item.m_comIcon.m_holder.visible = false;
|
|
@@ -196,44 +218,44 @@ namespace GFGGame
|
|
|
{
|
|
|
GObject obj = context.sender as GObject;
|
|
|
int index = (int)obj.data;
|
|
|
- TouchClickItem(index);
|
|
|
- Timers.inst.Add(1f, 0, UpClickDataTime,index);
|
|
|
+ _chooseIndex = index;
|
|
|
+ HandClickItem(index);
|
|
|
}
|
|
|
|
|
|
- void TouchClickItem(int index)
|
|
|
+ private void HandClickItem(int index)
|
|
|
{
|
|
|
- if (!touchFlipOpen)
|
|
|
- return;
|
|
|
-
|
|
|
+ _ui.m_touchFlipOpen.touchable = true;
|
|
|
+ _handClick = true;
|
|
|
ClickItem(index);
|
|
|
+ Timers.inst.Add(1f, 1, UpClickDataTime,index);
|
|
|
}
|
|
|
|
|
|
void ClickItem(int index)
|
|
|
{
|
|
|
- if (!_recordOpenIndex.Contains(index)) {
|
|
|
-
|
|
|
- //touchFlipOpen = false;
|
|
|
-
|
|
|
+ if (!_recordOpenIndex.Contains(index))
|
|
|
+ {
|
|
|
UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
|
|
|
- item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
|
|
|
-
|
|
|
- if (_recordOpenIndex.Count >= _rewardList.Count)
|
|
|
+ if (_recordOpenIndex.Count >= _rewardList.Count - 1)
|
|
|
_ui.m_BtnPass.visible = false;
|
|
|
|
|
|
//先翻开牌面
|
|
|
- if (!item.m_comIcon.m_imgNew.visible)
|
|
|
+ if (!item.m_comIcon.m_imgNew.visible || _countNewRecord < 1)
|
|
|
{
|
|
|
HideOtherShowWindow();
|
|
|
- _recordOpenIndex.Add(index);
|
|
|
- touchFlipOpen = true;
|
|
|
- return;
|
|
|
- }
|
|
|
- else {
|
|
|
- if (_countNewRecord <= 1) {
|
|
|
- HideOtherShowWindow();
|
|
|
- _countNewRecord += 1;
|
|
|
- return;
|
|
|
+ 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) {
|
|
|
+ if (_handClick)
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ _recordOpenIndex.Add(index);
|
|
|
}
|
|
|
+ else if (_countNewRecord < 1)
|
|
|
+ _countNewRecord += 1;
|
|
|
+
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
if (item.m_comIcon.m_imgNew.visible && _countNewRecord >= 1)
|
|
@@ -243,11 +265,11 @@ namespace GFGGame
|
|
|
{
|
|
|
if (_countShow < 1)
|
|
|
{
|
|
|
+ _countShow += 1;
|
|
|
ViewManager.Hide<GetSuitItemVIew>();
|
|
|
_rewardItemList.Clear();
|
|
|
_rewardItemList.Add(_rewardList[index]);
|
|
|
ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
- _countShow += 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -255,7 +277,6 @@ namespace GFGGame
|
|
|
ViewManager.Hide<LuckyBoxNewCardView>();
|
|
|
GetSuitItemController.TryShow(_itemIdList[index]);
|
|
|
_recordOpenIndex.Add(index);
|
|
|
- touchFlipOpen = true;
|
|
|
_countShow = 0;
|
|
|
_countNewRecord = 0;
|
|
|
}
|
|
@@ -267,31 +288,78 @@ namespace GFGGame
|
|
|
_rewardItemList.Add(_rewardList[index]);
|
|
|
ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
|
|
|
_recordOpenIndex.Add(index);
|
|
|
- touchFlipOpen = true;
|
|
|
_countNewRecord = 0;
|
|
|
}
|
|
|
}
|
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
+
|
|
|
+ if (_handClick)
|
|
|
+ {
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
+ Timers.inst.Remove(UpClickDataTime);
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ else{
|
|
|
GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void OnClickLoaBg()
|
|
|
{
|
|
|
if (_recordOpenIndex.Count >= _rewardList.Count)
|
|
|
+ {
|
|
|
+ _chooseIndex = -1;
|
|
|
this.Hide();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ for (int index = 0; index < _rewardList.Count; index++)
|
|
|
+ {
|
|
|
+ if (!_recordOpenIndex.Contains(index))
|
|
|
+ {
|
|
|
+ _chooseIndex = index;
|
|
|
+ HandClickItem(index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnPass()
|
|
|
{
|
|
|
+ for (int index = 0; index < _rewardList.Count; index++)
|
|
|
+ {
|
|
|
+ if (!_recordOpenIndex.Contains(index))
|
|
|
+ {
|
|
|
+ int count = 0;
|
|
|
+ bool isFirst = false;
|
|
|
+ for (int i = 0; i < _rewardList.Count; i++)
|
|
|
+ {
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ _chooseIndex = index;
|
|
|
+ ClickItem(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ClickPass();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ClickPass()
|
|
|
+ {
|
|
|
+ _ui.m_touchFlipOpen.touchable = true;
|
|
|
Timers.inst.Add(1f, 0, UpDataTime);
|
|
|
}
|
|
|
|
|
|
private void UpDataTime(object param = null)
|
|
|
{
|
|
|
- if (_recordOpenIndex.Count >= _rewardList.Count) {
|
|
|
+ if (_recordOpenIndex.Count >= _rewardList.Count) {
|
|
|
Timers.inst.Remove(UpDataTime);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
HideOtherShowWindow();
|
|
|
}
|
|
|
|
|
@@ -310,6 +378,7 @@ namespace GFGGame
|
|
|
if (_recordOpenIndex.Contains(index))
|
|
|
{
|
|
|
Timers.inst.Remove(UpClickDataTime);
|
|
|
+ _ui.m_touchFlipOpen.touchable = false;
|
|
|
HideOtherShowWindow();
|
|
|
}
|
|
|
else
|