|
@@ -11,6 +11,9 @@ namespace GFGGame
|
|
private List<ItemData> itemList;
|
|
private List<ItemData> itemList;
|
|
private GComponent _curComItem;
|
|
private GComponent _curComItem;
|
|
private int openCount = 0;
|
|
private int openCount = 0;
|
|
|
|
+ private List<ItemData> newItemList = new List<ItemData>();
|
|
|
|
+ private List<int> newCardList = new List<int>();
|
|
|
|
+ private List<int> openIndexList = new List<int>();
|
|
|
|
|
|
private List<GameObject> _effects = new List<GameObject>();
|
|
private List<GameObject> _effects = new List<GameObject>();
|
|
private List<GoWrapper> _wrappers = new List<GoWrapper>();
|
|
private List<GoWrapper> _wrappers = new List<GoWrapper>();
|
|
@@ -46,6 +49,7 @@ namespace GFGGame
|
|
_ui.m_loaBg.onClick.Add(OnClickBg);
|
|
_ui.m_loaBg.onClick.Add(OnClickBg);
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bj_ckzxin");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bj_ckzxin");
|
|
_ui.m_loaOpen.onClick.Add(OnClickOpen);
|
|
_ui.m_loaOpen.onClick.Add(OnClickOpen);
|
|
|
|
+ _ui.m_btnPass.onClick.Add(OnBtnPassClick);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -82,6 +86,7 @@ namespace GFGGame
|
|
// _ui.m_itemOne.target.visible = false;
|
|
// _ui.m_itemOne.target.visible = false;
|
|
_ui.m_t1.Play();
|
|
_ui.m_t1.Play();
|
|
openCount = 0;
|
|
openCount = 0;
|
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
}
|
|
}
|
|
|
|
|
|
private void OnClickBg()
|
|
private void OnClickBg()
|
|
@@ -118,19 +123,6 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // private void HideAllItem()
|
|
|
|
- // {
|
|
|
|
- // _ui.m_itemOne.target.visible = false;
|
|
|
|
- // for (int i = 0; i < 10; i++)
|
|
|
|
- // {
|
|
|
|
- // GObject itemObject = _ui.target.GetChild("item" + i);
|
|
|
|
- // if (itemObject != null)
|
|
|
|
- // {
|
|
|
|
- // itemObject.visible = false;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
private void UpdateItem(int index, GObject obj)
|
|
private void UpdateItem(int index, GObject obj)
|
|
{
|
|
{
|
|
ItemData itemData = itemList[index];
|
|
ItemData itemData = itemList[index];
|
|
@@ -211,6 +203,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
private bool PlayOpenAni(GComponent component)
|
|
private bool PlayOpenAni(GComponent component)
|
|
{
|
|
{
|
|
Transition transition = component.GetTransition("t1");
|
|
Transition transition = component.GetTransition("t1");
|
|
@@ -240,7 +234,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else if (cfg.itemType == ConstItemType.CARD)
|
|
else if (cfg.itemType == ConstItemType.CARD)
|
|
{
|
|
{
|
|
- ViewManager.Show<LuckyBoxNewCardView>(itemData.id);
|
|
|
|
|
|
+ ViewManager.Show<LuckyBoxNewCardView>(new object[] { itemData.id });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
openCount++;
|
|
openCount++;
|
|
@@ -258,5 +252,64 @@ namespace GFGGame
|
|
GoodsItemTipsController.ShowItemTips(itemID);
|
|
GoodsItemTipsController.ShowItemTips(itemID);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void OnBtnPassClick()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_loaMask.visible = true;
|
|
|
|
+ if (itemList.Count == 1)
|
|
|
|
+ {
|
|
|
|
+ PlayOpenAni(_ui.m_itemOne.target);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ Timers.inst.Add(0.5f, itemList.Count, UpdateTime);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void UpdateTime(object param)
|
|
|
|
+ {
|
|
|
|
+ GComponent component = _ui.target.GetChild("item" + openCount).asCom;
|
|
|
|
+ Transition transition = component.GetTransition("t1");
|
|
|
|
+ GComponent comIcon = component.GetChild("comIcon").asCom;
|
|
|
|
+ GImage imgNew = comIcon.GetChild("imgNew").asImage;
|
|
|
|
+ openCount++;
|
|
|
|
+ if (transition.playing || comIcon.skew == Vector2.zero) return;
|
|
|
|
+ if (imgNew.visible)
|
|
|
|
+ {
|
|
|
|
+ ItemData itemData = component.data as ItemData;
|
|
|
|
+ ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
|
+ if (cfg.itemType == ConstItemType.DRESS_UP)
|
|
|
|
+ {
|
|
|
|
+ newItemList.Add(itemData);
|
|
|
|
+ }
|
|
|
|
+ else if (cfg.itemType == ConstItemType.CARD)
|
|
|
|
+ {
|
|
|
|
+ newCardList.Add(itemData.id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (openCount == itemList.Count)
|
|
|
|
+ {
|
|
|
|
+ transition.Play(PlayComplete);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ transition.Play();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void PlayComplete()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_loaMask.visible = false;
|
|
|
|
+ _ui.m_loaOpen.visible = false;
|
|
|
|
+ if (newItemList.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(new object[] { newItemList });
|
|
|
|
+ }
|
|
|
|
+ if (newCardList.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<LuckyBoxNewCardView>(newCardList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|