|
@@ -9,7 +9,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
private UI_LuckBoxBonusUI _ui;
|
|
private UI_LuckBoxBonusUI _ui;
|
|
private List<ItemData> itemList;
|
|
private List<ItemData> itemList;
|
|
-
|
|
|
|
|
|
+ private GComponent _curComItem;
|
|
private int openCount = 0;
|
|
private int openCount = 0;
|
|
|
|
|
|
private List<GameObject> _effects = new List<GameObject>();
|
|
private List<GameObject> _effects = new List<GameObject>();
|
|
@@ -53,9 +53,10 @@ namespace GFGGame
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
|
|
itemList = (viewData as object[])[0] as List<ItemData>;
|
|
itemList = (viewData as object[])[0] as List<ItemData>;
|
|
|
|
+ _ui.m_loaOpen.visible = true;
|
|
|
|
+ _ui.m_loaMask.visible = true;
|
|
if (itemList != null)
|
|
if (itemList != null)
|
|
{
|
|
{
|
|
- _ui.m_loaOpen.visible = true;
|
|
|
|
int count = itemList.Count;
|
|
int count = itemList.Count;
|
|
if (count == 10)
|
|
if (count == 10)
|
|
{
|
|
{
|
|
@@ -71,11 +72,16 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_ui.m_loaOpen.visible = false;
|
|
_ui.m_loaOpen.visible = false;
|
|
}
|
|
}
|
|
|
|
+ _ui.m_t0.Play(UpdateView);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
|
|
+ // _ui.m_grpItems.visible = false;
|
|
|
|
+ // _ui.m_itemOne.target.visible = false;
|
|
|
|
+ _ui.m_t1.Play();
|
|
|
|
+ openCount = 0;
|
|
}
|
|
}
|
|
|
|
|
|
private void OnClickBg()
|
|
private void OnClickBg()
|
|
@@ -83,8 +89,16 @@ namespace GFGGame
|
|
this.Hide();
|
|
this.Hide();
|
|
ViewManager.Show(ViewName.LUCKY_BOX_VIEW, ViewManager.GetGoBackDatas(ViewName.LUCKY_BOX_STAR_VIEW));
|
|
ViewManager.Show(ViewName.LUCKY_BOX_VIEW, ViewManager.GetGoBackDatas(ViewName.LUCKY_BOX_STAR_VIEW));
|
|
GetSuitItemController.TryShow(0);
|
|
GetSuitItemController.TryShow(0);
|
|
|
|
+ _ui.m_t0.Stop(true, false);
|
|
}
|
|
}
|
|
|
|
+ private void UpdateView()
|
|
|
|
+ {
|
|
|
|
|
|
|
|
+ _ui.m_loaMask.visible = false;
|
|
|
|
+ int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
|
|
|
|
+ List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
|
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(new object[] { itemDatas });
|
|
|
|
+ }
|
|
private void ShowBonusList()
|
|
private void ShowBonusList()
|
|
{
|
|
{
|
|
if (itemList.Count > 1)
|
|
if (itemList.Count > 1)
|
|
@@ -104,18 +118,18 @@ 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 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)
|
|
{
|
|
{
|
|
@@ -148,7 +162,7 @@ namespace GFGGame
|
|
itemUI.m_comIcon.m_c1.selectedIndex = itemCfg.rarity;
|
|
itemUI.m_comIcon.m_c1.selectedIndex = itemCfg.rarity;
|
|
RarityIconController.UpdateRarityIcon(itemUI.m_comIcon.m_rarity, itemData.id, false);
|
|
RarityIconController.UpdateRarityIcon(itemUI.m_comIcon.m_rarity, itemData.id, false);
|
|
itemUI.m_comIcon.m_icon.data = itemData.id;
|
|
itemUI.m_comIcon.m_icon.data = itemData.id;
|
|
-
|
|
|
|
|
|
+ itemUI.target.data = itemData;
|
|
// itemUI.m_comIcon.target.SetScale(0, 0);
|
|
// itemUI.m_comIcon.target.SetScale(0, 0);
|
|
itemUI.m_t0.Play();
|
|
itemUI.m_t0.Play();
|
|
UI_LuckyBoxBonusItem.ProxyEnd();
|
|
UI_LuckyBoxBonusItem.ProxyEnd();
|
|
@@ -176,10 +190,16 @@ namespace GFGGame
|
|
private void OnClickItem(EventContext context)
|
|
private void OnClickItem(EventContext context)
|
|
{
|
|
{
|
|
GComponent item = context.sender as GComponent;
|
|
GComponent item = context.sender as GComponent;
|
|
|
|
+
|
|
PlayOpenAni(item);
|
|
PlayOpenAni(item);
|
|
}
|
|
}
|
|
private void OnClickOpen()
|
|
private void OnClickOpen()
|
|
{
|
|
{
|
|
|
|
+ if (itemList.Count == 1)
|
|
|
|
+ {
|
|
|
|
+ PlayOpenAni(_ui.m_itemOne.target);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
for (int i = 0; i < itemList.Count; i++)
|
|
for (int i = 0; i < itemList.Count; i++)
|
|
{
|
|
{
|
|
GComponent component = _ui.target.GetChild("item" + i).asCom;
|
|
GComponent component = _ui.target.GetChild("item" + i).asCom;
|
|
@@ -196,12 +216,36 @@ namespace GFGGame
|
|
Transition transition = component.GetTransition("t1");
|
|
Transition transition = component.GetTransition("t1");
|
|
GComponent comIcon = component.GetChild("comIcon").asCom;
|
|
GComponent comIcon = component.GetChild("comIcon").asCom;
|
|
if (transition.playing || comIcon.skew == Vector2.zero) return false;
|
|
if (transition.playing || comIcon.skew == Vector2.zero) return false;
|
|
|
|
+ GImage imgNew = component.GetChild("comIcon").asCom.GetChild("imgNew").asImage;
|
|
|
|
+ if (imgNew.visible)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_loaMask.visible = true;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ _curComItem = component;
|
|
transition.Play(UpdateOpenCount);
|
|
transition.Play(UpdateOpenCount);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
private void UpdateOpenCount()
|
|
private void UpdateOpenCount()
|
|
{
|
|
{
|
|
|
|
+ GImage imgNew = _curComItem.GetChild("comIcon").asCom.GetChild("imgNew").asImage;
|
|
|
|
+ if (imgNew.visible)
|
|
|
|
+ {
|
|
|
|
+ ItemData itemData = _curComItem.data as ItemData;
|
|
|
|
+ ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
|
+ if (cfg.itemType == ConstItemType.DRESS_UP)
|
|
|
|
+ {
|
|
|
|
+ List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemData.id, itemData.num);
|
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(new object[] { itemDatas });
|
|
|
|
+ }
|
|
|
|
+ else if (cfg.itemType == ConstItemType.CARD)
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<LuckyBoxNewDressView>(itemData.id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
openCount++;
|
|
openCount++;
|
|
|
|
+ _ui.m_loaMask.visible = false;
|
|
|
|
+
|
|
if (openCount == itemList.Count)
|
|
if (openCount == itemList.Count)
|
|
{
|
|
{
|
|
_ui.m_loaOpen.visible = false;
|
|
_ui.m_loaOpen.visible = false;
|