|
@@ -21,14 +21,15 @@ namespace GFGGame
|
|
|
|
|
|
private DressUpObjUI _dressUpObjUIChangXi;
|
|
private DressUpObjUI _dressUpObjUIChangXi;
|
|
|
|
|
|
- private bool isActiveBoxOpen = false;
|
|
|
|
|
|
+ Dictionary<int,GObject> _listActivityBtnObj = new Dictionary<int, GObject>();
|
|
|
|
+
|
|
private int _activeBoxId = 0;
|
|
private int _activeBoxId = 0;
|
|
private int _curIndex = 0;
|
|
private int _curIndex = 0;
|
|
private int _activityId = 0;
|
|
private int _activityId = 0;
|
|
|
|
+ private bool scrollTouch = true; //左右箭头点击等滑动完成后才可以再次点击
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
-
|
|
|
|
// Clear Effect
|
|
// Clear Effect
|
|
foreach (var v in _effectUIDic)
|
|
foreach (var v in _effectUIDic)
|
|
{
|
|
{
|
|
@@ -76,19 +77,15 @@ namespace GFGGame
|
|
|
|
|
|
_dressUpObjUIXiHe = new DressUpObjUI("SceneDressUp");
|
|
_dressUpObjUIXiHe = new DressUpObjUI("SceneDressUp");
|
|
_dressUpObjUIChangXi = new DressUpObjUI("SceneDressUp");
|
|
_dressUpObjUIChangXi = new DressUpObjUI("SceneDressUp");
|
|
- // _ui.m_txtRemainTimes.visible = false;
|
|
|
|
_valueBarController = new ValueBarController(_ui.m_valueBar);
|
|
_valueBarController = new ValueBarController(_ui.m_valueBar);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
- // _ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
|
|
|
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
- // _ui.m_listBg.SetVirtual();
|
|
|
|
_ui.m_listBg.itemRenderer = RenderListBgItem;
|
|
_ui.m_listBg.itemRenderer = RenderListBgItem;
|
|
- // _ui.m_listBg.itemProvider = GetListItemResource;
|
|
|
|
|
|
+ _ui.m_listBg.SetVirtualAndLoop();
|
|
_ui.m_listBg.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
|
_ui.m_listBg.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
|
-
|
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
@@ -141,154 +138,62 @@ namespace GFGGame
|
|
|
|
|
|
LuckyBoxDataManager.Instance.currentBoxId = boxId;
|
|
LuckyBoxDataManager.Instance.currentBoxId = boxId;
|
|
|
|
|
|
- bool actLimitTsyOpen = LuckyBoxDataManager.Instance.GetActLimitTsyOpen();
|
|
|
|
- if (_activeBoxId > 0)
|
|
|
|
- Timers.inst.Add(1, 0, CheckTime);
|
|
|
|
- if (actLimitTsyOpen)// && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2
|
|
|
|
- Timers.inst.Add(1, 0, UpdateTime);
|
|
|
|
-
|
|
|
|
_curIndex = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(boxId);
|
|
_curIndex = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(boxId);
|
|
|
|
+ LuckyBoxDataManager.Instance.luckyBoxIndex = _curIndex;
|
|
|
|
+ _listActivityBtnObj.Clear();
|
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
|
+ {
|
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
|
+ }
|
|
|
|
+ _effectUIDic.Clear();
|
|
_ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Count;
|
|
_ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Count;
|
|
_ui.m_listBg.ScrollToView(_curIndex);
|
|
_ui.m_listBg.ScrollToView(_curIndex);
|
|
_ui.m_listBg.scrollPane.decelerationRate = 0.8f;
|
|
_ui.m_listBg.scrollPane.decelerationRate = 0.8f;
|
|
- LuckyBoxDataManager.Instance.luckyBoxIndex = _curIndex;
|
|
|
|
|
|
|
|
OnListBgScroll();
|
|
OnListBgScroll();
|
|
- updateBoxEffect();
|
|
|
|
-
|
|
|
|
- Timers.inst.AddUpdate(CheckGuide);
|
|
|
|
- Timers.inst.Add(1f, 0, OnTimerUpdate, 1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private async void GetWishingPoolInfo(int activityId)
|
|
|
|
- {
|
|
|
|
- bool result = await LuckyBoxSProxy.ReqGetWishingPoolInfo();
|
|
|
|
- if (result)
|
|
|
|
- {
|
|
|
|
- int index = LuckyBoxDataManager.Instance.KsActivityId.IndexOf(activityId);
|
|
|
|
- if (index < 0 || !LuckyBoxDataManager.Instance.VsStatus[index])
|
|
|
|
- ViewManager.Show<LuckyBoxWishView>(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- private void OnTimerUpdate(object param)
|
|
|
|
- {
|
|
|
|
- int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
|
- long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
|
|
- GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
|
- UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
|
- if (freeTime > 0)
|
|
|
|
- {
|
|
|
|
- long timeDifference = freeTime - TimeHelper.ServerNow();
|
|
|
|
- if (timeDifference > 0)
|
|
|
|
- {
|
|
|
|
- comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
|
|
- comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
|
|
- string strFreeTime = TimeUtil.FormattingTimeTo_DDHHmm(timeDifference);
|
|
|
|
- comBox.m_comLuckBoxBtn.m_txtFreeTime.text = string.Format("{0}后免费", strFreeTime);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 1;
|
|
|
|
- comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
|
|
- }
|
|
|
|
- RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1, "", -29, 9);
|
|
|
|
- }
|
|
|
|
|
|
+ bool actLimitTsyOpen = LuckyBoxDataManager.Instance.GetActLimitTsyOpen();
|
|
|
|
+ //时间倒计时
|
|
|
|
+ if (_activeBoxId > 0)
|
|
|
|
+ Timers.inst.Add(1, 0, CheckTime);
|
|
|
|
+ //第二个活动的倒计时
|
|
|
|
+ if (actLimitTsyOpen)// && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2
|
|
|
|
+ Timers.inst.Add(1, 0, UpdateTime);
|
|
|
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, LuckyBoxDataManager.Instance.RedBtnLeft(_curIndex));
|
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_btnRight, LuckyBoxDataManager.Instance.RedBtnRight(_curIndex),"",-60,70);
|
|
|
|
- UI_ComBox1.ProxyEnd();
|
|
|
|
|
|
+ Timers.inst.AddUpdate(CheckGuide);
|
|
}
|
|
}
|
|
|
|
|
|
private void RenderListBgItem(int index, GObject obj)
|
|
private void RenderListBgItem(int index, GObject obj)
|
|
{
|
|
{
|
|
|
|
+ UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OnBtnLeftClick()
|
|
|
|
- {
|
|
|
|
- int index = _curIndex - 1;
|
|
|
|
- if (index < 0) return;
|
|
|
|
- _ui.m_listBg.ScrollToView(index, true);
|
|
|
|
-
|
|
|
|
- if (_activityId > 0 && index + 1 == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
- GetWishingPoolInfo(_activityId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OnBtnRightClick()
|
|
|
|
- {
|
|
|
|
- int index = _curIndex + 1;
|
|
|
|
- // if (index >= LuckyBoxDataManager.Instance.luckyBoxIds.Count) return;
|
|
|
|
- index = Mathf.Min(_ui.m_listBg.numItems - 1, index);
|
|
|
|
- _ui.m_listBg.ScrollToView(index, true);
|
|
|
|
-
|
|
|
|
- if (_activityId > 0 && index + 1 == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
- GetWishingPoolInfo(_activityId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OnScrollEnd()
|
|
|
|
- {
|
|
|
|
- // 未更新滚动位置的时候,不更新,防止不停的播放渐入动画
|
|
|
|
- int index = _ui.m_listBg.GetFirstChildInView();
|
|
|
|
- if(index == _curIndex)
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- OnListBgScroll();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void OnListBgScroll()
|
|
|
|
- {
|
|
|
|
- if (_luckyBoxCtrl.ContainsKey(LuckyBoxDataManager.Instance.currentBoxId)) _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
|
|
|
|
- _curIndex = _ui.m_listBg.GetFirstChildInView();
|
|
|
|
- LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
|
- if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
|
|
|
|
- {
|
|
|
|
- _valueBarController.Controller(3);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- _valueBarController.Controller(4);
|
|
|
|
- }
|
|
|
|
- _valueBarController.UpdateCJ();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- UpdateListItem();
|
|
|
|
- _ui.m_btnLeft.grayed = _curIndex <= 0;
|
|
|
|
- _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
|
|
|
|
- LuckyBoxDataManager.Instance.luckyBoxIndex = _curIndex;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<GObject> _listActivityBtnObj = new List<GObject>();
|
|
|
|
- private void UpdateListItem()
|
|
|
|
- {
|
|
|
|
- int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
LuckyBoxDataManager.Instance.InitData(boxId);
|
|
LuckyBoxDataManager.Instance.InitData(boxId);
|
|
|
|
+ if(!_listActivityBtnObj.ContainsKey(boxId))
|
|
|
|
+ _listActivityBtnObj.Add(boxId,obj);
|
|
|
|
+ else
|
|
|
|
+ _listActivityBtnObj[boxId] = obj;
|
|
|
|
|
|
- GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
|
- UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
|
- _listActivityBtnObj.Add(obj);
|
|
|
|
int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
if (activityId > 0 && boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
if (activityId > 0 && boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
{
|
|
{
|
|
comBox.m_showActivityType.selectedIndex = 1;
|
|
comBox.m_showActivityType.selectedIndex = 1;
|
|
UpGiftBox(comBox);
|
|
UpGiftBox(comBox);
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ else
|
|
comBox.m_showActivityType.selectedIndex = 0;
|
|
comBox.m_showActivityType.selectedIndex = 0;
|
|
|
|
|
|
- if (!_luckyBoxCtrl.ContainsKey(boxId))
|
|
|
|
|
|
+ if (_luckyBoxCtrl.ContainsKey(boxId))
|
|
{
|
|
{
|
|
- _luckyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
|
|
|
|
|
|
+ _luckyBoxCtrl[boxId].Dispose();
|
|
|
|
+ _luckyBoxCtrl.Remove(boxId);
|
|
}
|
|
}
|
|
|
|
|
|
- _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
|
-
|
|
|
|
- if(boxId != LuckyBoxDataManager.BOX_ID_3)
|
|
|
|
|
|
+ _luckyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
|
|
|
|
+
|
|
|
|
+ if (boxId != LuckyBoxDataManager.BOX_ID_3)
|
|
{
|
|
{
|
|
- if(!_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
|
|
|
|
+ if (!_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
{
|
|
{
|
|
_effectUIDic.Add("Button_Text_DianCang" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox", "Button_Text_DianCang"));
|
|
_effectUIDic.Add("Button_Text_DianCang" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox", "Button_Text_DianCang"));
|
|
}
|
|
}
|
|
@@ -300,17 +205,9 @@ namespace GFGGame
|
|
EffectUIPool.Recycle(_effectUIDic["Button_Text_DianCang" + boxId]);
|
|
EffectUIPool.Recycle(_effectUIDic["Button_Text_DianCang" + boxId]);
|
|
_effectUIDic.Remove("Button_Text_DianCang" + boxId);
|
|
_effectUIDic.Remove("Button_Text_DianCang" + boxId);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
- //comBox.m_comLuckBoxBtn.m_imgSpecial.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
|
|
|
|
|
- //GGraph holder = comBox.m_comLuckBoxBtn.m_btnBuyTen.GetChild("holder").asGraph;
|
|
|
|
- //holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
|
comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
-
|
|
|
|
-
|
|
|
|
- //_effectUI1 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", "Button_Glow");
|
|
|
|
-
|
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
|
|
|
|
|
|
@@ -324,8 +221,13 @@ namespace GFGGame
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyTen.data == null)
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyTen.data == null)
|
|
{
|
|
{
|
|
|
|
+ string strKey = "Button_public" + boxId;
|
|
|
|
+ if (_effectUIDic.ContainsKey(strKey)) {
|
|
|
|
+ EffectUIPool.Recycle(_effectUIDic[strKey]);
|
|
|
|
+ _effectUIDic.Remove(strKey);
|
|
|
|
+ }
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.onClick.Add(OnClickBtnBuyTen);
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.onClick.Add(OnClickBtnBuyTen);
|
|
- _effectUIDic.Add("Button_public" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
|
|
|
|
+ _effectUIDic.Add(strKey, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
}
|
|
}
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
|
|
|
|
|
|
@@ -350,19 +252,79 @@ namespace GFGGame
|
|
{
|
|
{
|
|
long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
long curTime = TimeHelper.ServerNow();
|
|
long curTime = TimeHelper.ServerNow();
|
|
- // TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
|
long time = endTime - curTime;
|
|
long time = endTime - curTime;
|
|
string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
comBox.m_txtTime.text = string.Format("轮换倒计时:{0}", strTime);
|
|
comBox.m_txtTime.text = string.Format("轮换倒计时:{0}", strTime);
|
|
- //comBox.m_loaTitle.url = "ui://LuckyBox/zx_title_1";
|
|
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+
|
|
|
|
+ UI_ComBox1.ProxyEnd();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private async void GetWishingPoolInfo(int activityId)
|
|
|
|
+ {
|
|
|
|
+ bool result = await LuckyBoxSProxy.ReqGetWishingPoolInfo();
|
|
|
|
+ if (result)
|
|
{
|
|
{
|
|
- //comBox.m_loaTitle.url = string.Format("ui://LuckyBox/zx_title_{0}", boxId);
|
|
|
|
|
|
+ int index = LuckyBoxDataManager.Instance.KsActivityId.IndexOf(activityId);
|
|
|
|
+ if (index < 0 || !LuckyBoxDataManager.Instance.VsStatus[index])
|
|
|
|
+ ViewManager.Show<LuckyBoxWishView>(ConstLimitTimeActivityType.ActLimitTsy);
|
|
}
|
|
}
|
|
- UI_ComBox1.ProxyEnd();
|
|
|
|
- UpdateListItemData();
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnBtnLeftClick()
|
|
|
|
+ {
|
|
|
|
+ if (!scrollTouch) return;
|
|
|
|
+ scrollTouch = false;
|
|
|
|
+ int index = _curIndex - 1;
|
|
|
|
+ _ui.m_listBg.ScrollToView(index, true);
|
|
|
|
+ if (_activityId > 0 && index + 1 == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
+ GetWishingPoolInfo(_activityId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnBtnRightClick()
|
|
|
|
+ {
|
|
|
|
+ if (!scrollTouch) return;
|
|
|
|
+ scrollTouch = false;
|
|
|
|
+ int index = _curIndex + 1;
|
|
|
|
+ _ui.m_listBg.ScrollToView(index, true);
|
|
|
|
+ if (_activityId > 0 && index + 1 == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
+ GetWishingPoolInfo(_activityId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnScrollEnd()
|
|
|
|
+ {
|
|
|
|
+ scrollTouch = true;
|
|
|
|
+ // 未更新滚动位置的时候,不更新,防止不停的播放渐入动画
|
|
|
|
+ int index = _ui.m_listBg.GetFirstChildInView();
|
|
|
|
+ if (index == _curIndex)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ OnListBgScroll();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnListBgScroll()
|
|
|
|
+ {
|
|
|
|
+ LuckyBoxController valueBox;
|
|
|
|
+ _luckyBoxCtrl.TryGetValue(LuckyBoxDataManager.Instance.currentBoxId, out valueBox);
|
|
|
|
+
|
|
|
|
+ if (valueBox != null)
|
|
|
|
+ _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
|
|
|
|
+
|
|
|
|
+ _curIndex = _ui.m_listBg.GetFirstChildInView();
|
|
|
|
+
|
|
|
|
+ LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
|
+ if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
|
|
|
|
+ _valueBarController.Controller(3);
|
|
|
|
+ else
|
|
|
|
+ _valueBarController.Controller(4);
|
|
|
|
+
|
|
|
|
+ _valueBarController.UpdateCJ();
|
|
|
|
+
|
|
|
|
+ _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
|
+ LuckyBoxDataManager.Instance.luckyBoxIndex = _curIndex;
|
|
UpdateFreeInfo();
|
|
UpdateFreeInfo();
|
|
|
|
+ UpdateListItemData();
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateBtnReward()
|
|
private void UpdateBtnReward()
|
|
@@ -446,20 +408,16 @@ namespace GFGGame
|
|
var list = activityInfoByTypeList
|
|
var list = activityInfoByTypeList
|
|
.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
|
|
.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
|
|
if (list.Count == 0)
|
|
if (list.Count == 0)
|
|
- {
|
|
|
|
PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
- }
|
|
|
|
else
|
|
else
|
|
- {
|
|
|
|
ViewManager.Show<RushSaleGiftBoxView>(new object[] { ActivityType.XSLB3, this.viewData });
|
|
ViewManager.Show<RushSaleGiftBoxView>(new object[] { ActivityType.XSLB3, this.viewData });
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateListItemData()
|
|
private void UpdateListItemData()
|
|
{
|
|
{
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
- GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
|
|
|
+ GObject obj = _listActivityBtnObj[boxId];
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
LuckyBoxDataManager.Instance.GetOwnedCount(boxId, out int count, out int totalCount);
|
|
LuckyBoxDataManager.Instance.GetOwnedCount(boxId, out int count, out int totalCount);
|
|
comBox.m_txtOwned.SetVar("v1", "" + count).FlushVars();
|
|
comBox.m_txtOwned.SetVar("v1", "" + count).FlushVars();
|
|
@@ -503,7 +461,6 @@ namespace GFGGame
|
|
PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
Timers.inst.Remove(UpdateTime);
|
|
Timers.inst.Remove(UpdateTime);
|
|
endTime = curTime;
|
|
endTime = curTime;
|
|
- //OnClickBtnBack();
|
|
|
|
}
|
|
}
|
|
TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
@@ -514,20 +471,13 @@ namespace GFGGame
|
|
//=====限时礼包倒计时END
|
|
//=====限时礼包倒计时END
|
|
}
|
|
}
|
|
|
|
|
|
- private void updateBoxEffect()
|
|
|
|
- {
|
|
|
|
- if (isActiveBoxOpen)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void OnClickBtnPreview(EventContext context)
|
|
private void OnClickBtnPreview(EventContext context)
|
|
{
|
|
{
|
|
GObject obj = context.sender as GObject;
|
|
GObject obj = context.sender as GObject;
|
|
int boxId = (int)obj.data;
|
|
int boxId = (int)obj.data;
|
|
ViewManager.Show<LuckyBoxPreShowView>(boxId);
|
|
ViewManager.Show<LuckyBoxPreShowView>(boxId);
|
|
}
|
|
}
|
|
|
|
+
|
|
private void OnClickBtnBuyOne(EventContext context)
|
|
private void OnClickBtnBuyOne(EventContext context)
|
|
{
|
|
{
|
|
GetSuitItemController.showSingle = true;
|
|
GetSuitItemController.showSingle = true;
|
|
@@ -606,10 +556,8 @@ namespace GFGGame
|
|
_luckyBoxCtrl[key].OnHide();
|
|
_luckyBoxCtrl[key].OnHide();
|
|
}
|
|
}
|
|
|
|
|
|
- Timers.inst.Remove(OnTimerUpdate);
|
|
|
|
Timers.inst.Remove(CheckTime);
|
|
Timers.inst.Remove(CheckTime);
|
|
Timers.inst.Remove(UpdateTime);
|
|
Timers.inst.Remove(UpdateTime);
|
|
- // Timers.inst.Remove(UpdateBg);
|
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
Timers.inst.Remove(CheckGuide);
|
|
Debug.Log("OnHide: LuckyBoxView");
|
|
Debug.Log("OnHide: LuckyBoxView");
|
|
}
|
|
}
|
|
@@ -627,30 +575,20 @@ namespace GFGGame
|
|
private void OnClickBtnBack()
|
|
private void OnClickBtnBack()
|
|
{
|
|
{
|
|
Reset();
|
|
Reset();
|
|
- //this.Hide();
|
|
|
|
ViewManager.GoBackFrom(typeof(LuckyBoxView).FullName);
|
|
ViewManager.GoBackFrom(typeof(LuckyBoxView).FullName);
|
|
}
|
|
}
|
|
|
|
|
|
- private void OnClickBtnHome()
|
|
|
|
- {
|
|
|
|
- GameController.GoBackToMainView();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void Reset()
|
|
private void Reset()
|
|
{
|
|
{
|
|
LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
|
|
LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
private void CheckGuide(object param)
|
|
private void CheckGuide(object param)
|
|
{
|
|
{
|
|
if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0)
|
|
if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0)
|
|
- {
|
|
|
|
UpdateToCheckGuide(null);
|
|
UpdateToCheckGuide(null);
|
|
- }
|
|
|
|
else
|
|
else
|
|
- {
|
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
Timers.inst.Remove(CheckGuide);
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
protected override void UpdateToCheckGuide(object param)
|
|
protected override void UpdateToCheckGuide(object param)
|
|
@@ -675,16 +613,19 @@ namespace GFGGame
|
|
private void UpdateFreeInfo()
|
|
private void UpdateFreeInfo()
|
|
{
|
|
{
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
- LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
|
|
long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
- GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
|
|
|
+ GObject obj = _listActivityBtnObj[boxId];
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
if (freeTime > 0)
|
|
if (freeTime > 0)
|
|
{
|
|
{
|
|
|
|
+ long timeDifference = freeTime - TimeHelper.ServerNow();
|
|
|
|
+
|
|
if (freeTime > TimeHelper.ServerNow())
|
|
if (freeTime > TimeHelper.ServerNow())
|
|
{
|
|
{
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
|
|
+ string strFreeTime = TimeUtil.FormattingTimeTo_DDHHmm(timeDifference);
|
|
|
|
+ comBox.m_comLuckBoxBtn.m_txtFreeTime.text = string.Format("{0}后免费", strFreeTime);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -697,8 +638,10 @@ namespace GFGGame
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
}
|
|
}
|
|
- RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1, "", -29, 9);
|
|
|
|
|
|
|
|
|
|
+ RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1, "", -29, 9);
|
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, LuckyBoxDataManager.Instance.RedBtnLeft(_curIndex));
|
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, LuckyBoxDataManager.Instance.RedBtnRight(_curIndex), "", -60, 70);
|
|
UI_ComBox1.ProxyEnd();
|
|
UI_ComBox1.ProxyEnd();
|
|
}
|
|
}
|
|
}
|
|
}
|