|
@@ -36,24 +36,22 @@ namespace GFGGame
|
|
|
private bool isFirst = true;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
- // for (int i = 0; i < _gameObjects.Count; i++)
|
|
|
- // {
|
|
|
- // SceneController.DestroyObjectFromView(_gameObjects[i]);
|
|
|
- // SceneController.DestroyObjectFromView(_gameObjects1[i]);
|
|
|
- // }
|
|
|
- ICollection keys0 = dicGameobj.Keys;
|
|
|
- foreach (int key in keys0)
|
|
|
- {
|
|
|
- for (int i = 0; i < dicGameobj[key].Count; i++)
|
|
|
- {
|
|
|
- SceneController.DestroyObjectFromView(dicGameobj[key][i]);
|
|
|
- SceneController.DestroyObjectFromView(dicGameobj1[key][i]);
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
base.Dispose();
|
|
|
}
|
|
|
+ protected override void OnHide()
|
|
|
+ {
|
|
|
+ int index = 0;
|
|
|
+ GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
|
|
|
|
|
|
+ // while (star != null && star.visible == true)
|
|
|
+ // {
|
|
|
+ // UI_ComStar comStar = UI_ComStar.Proxy(star);
|
|
|
+ // if (comStar.target.numChildren > 1) comStar.target.RemoveChildAt(1);
|
|
|
+ // if (comStar.target.numChildren > 1) comStar.target.RemoveChildAt(1);
|
|
|
+ // index++;
|
|
|
+ // }
|
|
|
+ }
|
|
|
protected override void OnInit()
|
|
|
{
|
|
|
base.OnInit();
|
|
@@ -63,6 +61,8 @@ namespace GFGGame
|
|
|
|
|
|
_ui.m_btnBack.visible = true;
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
protected override void OnShown()
|
|
|
{
|
|
@@ -77,6 +77,7 @@ namespace GFGGame
|
|
|
isFirst = true;
|
|
|
ResetStartView();
|
|
|
}
|
|
|
+
|
|
|
private void ResetStartView()
|
|
|
{
|
|
|
showGuide = GuideDataManager.GetGuideCountCopy(ConstGuideId.LUCKY_BOX) <= 0;
|
|
@@ -93,27 +94,36 @@ namespace GFGGame
|
|
|
comStar.m_c1.selectedIndex = 0;
|
|
|
comStar.m_imgLine.width = imgLineWidth;
|
|
|
comStar.m_imgLine.rotation = 0;
|
|
|
-
|
|
|
- if (isFirst && (!dicGameobj.ContainsKey(_ui.m_ctrlRewardsType.selectedIndex) || dicGameobj1[_ui.m_ctrlRewardsType.selectedIndex].Count <= index))
|
|
|
+ GComponent gcom;
|
|
|
+ if (comStar.target.numChildren > 1)
|
|
|
{
|
|
|
- GameObject gameObject = _gameObjects.Count > index ? _gameObjects[index] : null;
|
|
|
- GoWrapper wrapper = _wrappers.Count > index ? _wrappers[index] : null;
|
|
|
+ gcom = comStar.target.GetChildAt(1).asCom;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ gcom = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
|
|
|
string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck");
|
|
|
- SceneController.AddObjectToView(gameObject, wrapper, comStar.m_holder, resPath, out gameObject, out wrapper);
|
|
|
- if (!dicGameobj.ContainsKey(_ui.m_ctrlRewardsType.selectedIndex)) dicGameobj.Add(_ui.m_ctrlRewardsType.selectedIndex, new List<GameObject>());
|
|
|
- if (!dicWrappers.ContainsKey(_ui.m_ctrlRewardsType.selectedIndex)) dicWrappers.Add(_ui.m_ctrlRewardsType.selectedIndex, new List<GoWrapper>());
|
|
|
- dicGameobj[_ui.m_ctrlRewardsType.selectedIndex].Add(gameObject);
|
|
|
- dicWrappers[_ui.m_ctrlRewardsType.selectedIndex].Add(wrapper);
|
|
|
-
|
|
|
- GameObject gameObject1 = _gameObjects1.Count > index ? _gameObjects1[index] : null;
|
|
|
- GoWrapper wrapper1 = _wrappers1.Count > index ? _wrappers1[index] : null;
|
|
|
+ SceneController.AddObjectToView(null, null, gcom.GetChild("holder").asGraph, resPath, out GameObject gameObject, out GoWrapper wrapper);
|
|
|
+ }
|
|
|
+ gcom.visible = true;
|
|
|
+ comStar.target.AddChildAt(gcom, 1);
|
|
|
+
|
|
|
+ GComponent gcom1;
|
|
|
+ if (comStar.target.numChildren > 2)
|
|
|
+ {
|
|
|
+ gcom1 = comStar.target.GetChildAt(2).asCom;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ gcom1 = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
|
|
|
string resPath1 = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_dj");
|
|
|
- SceneController.AddObjectToView(gameObject1, wrapper1, comStar.m_holder1, resPath1, out gameObject1, out wrapper1);
|
|
|
- if (!dicGameobj1.ContainsKey(_ui.m_ctrlRewardsType.selectedIndex)) dicGameobj1.Add(_ui.m_ctrlRewardsType.selectedIndex, new List<GameObject>());
|
|
|
- if (!dicWrappers1.ContainsKey(_ui.m_ctrlRewardsType.selectedIndex)) dicWrappers1.Add(_ui.m_ctrlRewardsType.selectedIndex, new List<GoWrapper>());
|
|
|
- dicGameobj1[_ui.m_ctrlRewardsType.selectedIndex].Add(gameObject1);
|
|
|
- dicWrappers1[_ui.m_ctrlRewardsType.selectedIndex].Add(wrapper1);
|
|
|
+ SceneController.AddObjectToView(null, null, gcom1.GetChild("holder").asGraph, resPath1, out GameObject gameObject1, out GoWrapper wrapper1);
|
|
|
}
|
|
|
+ gcom1.visible = false;
|
|
|
+ comStar.target.AddChildAt(gcom1, 2);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
star.data = new Vector2(comStar.target.x, comStar.target.y);
|
|
|
comStars.Add(star);
|
|
|
|
|
@@ -155,7 +165,9 @@ namespace GFGGame
|
|
|
SetCurComStarTransfrom(comStarPos);
|
|
|
}
|
|
|
UI_ComStar comStar = UI_ComStar.Proxy(comStars[i]);
|
|
|
- comStar.m_c1.selectedIndex = 1;
|
|
|
+ comStar.target.GetChildAt(2).asCom.visible = true;
|
|
|
+ comStar.target.GetChildAt(1).asCom.visible = false;
|
|
|
+ // comStar.m_c1.selectedIndex = 1;
|
|
|
curComStar = comStars[i];
|
|
|
lastPos = Vector2.right;
|
|
|
|
|
@@ -234,10 +246,7 @@ namespace GFGGame
|
|
|
|
|
|
ViewManager.Show(ViewName.LUCKY_BOX_VIEW);
|
|
|
}
|
|
|
- protected override void OnHide()
|
|
|
- {
|
|
|
- base.OnHide();
|
|
|
- }
|
|
|
+
|
|
|
protected override void UpdateToCheckGuide(object param)
|
|
|
{
|
|
|
|