|
|
@@ -23,13 +23,13 @@ namespace GFGGame
|
|
|
private DressUpObjUI _dressUpObjUIChangXi;
|
|
|
private string activityEndTime = "[2024][2][2][00:00]";
|
|
|
|
|
|
- Dictionary<int,GObject> _listActivityBtnObj = new Dictionary<int, GObject>();
|
|
|
- private Dictionary<string, GGraph> effectNameDic = new Dictionary<string, GGraph>() { };
|
|
|
+ Dictionary<int, GObject> _listActivityBtnObj = new Dictionary<int, GObject>();
|
|
|
+ private Dictionary<string, GGraph> effectNameDic = new Dictionary<string, GGraph>() { };
|
|
|
|
|
|
private int _activeBoxId = 0;
|
|
|
private int _curIndex = 0;
|
|
|
private int _activityId = 0;
|
|
|
- private bool scrollTouch = true; //左右箭头点击等滑动完成后才可以再次点击
|
|
|
+ private bool scrollTouch = true; //左右箭头点击等滑动完成后才可以再次点击
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI2;
|
|
|
@@ -43,6 +43,7 @@ namespace GFGGame
|
|
|
{
|
|
|
EffectUIPool.Recycle(v.Value);
|
|
|
}
|
|
|
+
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
|
_effectUI1 = null;
|
|
|
EffectUIPool.Recycle(_effectUI2);
|
|
|
@@ -59,26 +60,31 @@ namespace GFGGame
|
|
|
_valueBarController.Dispose();
|
|
|
_valueBarController = null;
|
|
|
}
|
|
|
+
|
|
|
foreach (int key in _luckyBoxCtrl.Keys)
|
|
|
{
|
|
|
_luckyBoxCtrl[key].Dispose();
|
|
|
}
|
|
|
+
|
|
|
_luckyBoxCtrl.Clear();
|
|
|
if (_dressUpObjUIXiHe != null)
|
|
|
{
|
|
|
_dressUpObjUIXiHe.Dispose();
|
|
|
_dressUpObjUIXiHe = null;
|
|
|
}
|
|
|
+
|
|
|
if (_dressUpObjUIChangXi != null)
|
|
|
{
|
|
|
_dressUpObjUIChangXi.Dispose();
|
|
|
_dressUpObjUIChangXi = null;
|
|
|
}
|
|
|
+
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
|
}
|
|
|
+
|
|
|
base.Dispose();
|
|
|
}
|
|
|
|
|
|
@@ -100,7 +106,7 @@ namespace GFGGame
|
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
_ui.m_listBg.itemRenderer = RenderListBgItem;
|
|
|
- _ui.m_listBg.SetVirtualAndLoop(); //虚拟循环列表
|
|
|
+ _ui.m_listBg.SetVirtualAndLoop(); //虚拟循环列表
|
|
|
_ui.m_listBg.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
|
|
|
@@ -108,12 +114,41 @@ namespace GFGGame
|
|
|
effectNameDic.Add("zx_twy_cx", _ui.m_effectTWH);
|
|
|
effectNameDic.Add("zx_twy_xh", _ui.m_effectTWH2);
|
|
|
effectNameDic.Add("zx_zwy_yjzh", _ui.m_effectZWH2);
|
|
|
- _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_effectTWH, "ui_LuckyBox", "CK_TWH_01");
|
|
|
- _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_effectZWH, "ui_LuckyBox", "CK_ZWH_01");
|
|
|
- _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_effectTWH2, "ui_LuckyBox", "CK_TWH_02");
|
|
|
- _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_effectZWH2, "ui_LuckyBox", "CK_ZWH_02");
|
|
|
+ EffectUIPool.CreateEffectUI(_ui.m_effectTWH, "ui_LuckyBox", "CK_TWH_01",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUI1 = effect;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ EffectUIPool.CreateEffectUI(_ui.m_effectZWH, "ui_LuckyBox", "CK_ZWH_01",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUI2 = effect;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ EffectUIPool.CreateEffectUI(_ui.m_effectTWH2, "ui_LuckyBox", "CK_TWH_02",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUI1 = effect;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ EffectUIPool.CreateEffectUI(_ui.m_effectZWH2, "ui_LuckyBox", "CK_ZWH_02",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUI2 = effect;
|
|
|
+ }
|
|
|
+ });
|
|
|
AdaptScreen();
|
|
|
}
|
|
|
+
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
|
@@ -124,12 +159,12 @@ namespace GFGGame
|
|
|
EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD, UpdateBtnReward);
|
|
|
EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateBtnReward);
|
|
|
EventAgent.AddEventListener(ConstMessage.LUCKY_EFFECT_UPDATE, UpdateEffectVisible);
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
-
|
|
|
+
|
|
|
Debug.Log("OnShown:LuckyBoxView");
|
|
|
//防止引导检测之前触发点击事件
|
|
|
GRoot.inst.touchable = false;
|
|
|
@@ -146,21 +181,23 @@ namespace GFGGame
|
|
|
//第一个活动可能为轮换活动
|
|
|
if (LuckyBoxDataManager.Instance.RotatingId > 0)
|
|
|
{
|
|
|
- RotatingLuckyBoxCfg rotatingLuckyBox = CommonDataManager.Tables.TblRotatingLuckyBoxCfg.GetOrDefault(LuckyBoxDataManager.Instance.RotatingId);
|
|
|
+ RotatingLuckyBoxCfg rotatingLuckyBox =
|
|
|
+ CommonDataManager.Tables.TblRotatingLuckyBoxCfg.GetOrDefault(
|
|
|
+ LuckyBoxDataManager.Instance.RotatingId);
|
|
|
_activeBoxId = rotatingLuckyBox.LuckyBoxId;
|
|
|
LuckyBoxDataManager.Instance.endTime = TimeUtil.GetTimestamp(rotatingLuckyBox.EndTime);
|
|
|
LuckyBoxDataManager.Instance.luckyBoxIds.Insert(0, _activeBoxId);
|
|
|
}
|
|
|
|
|
|
- int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0]; //默认跳转进来是第一个活动
|
|
|
+ int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0]; //默认跳转进来是第一个活动
|
|
|
if (this.viewData != null)
|
|
|
{
|
|
|
- int index = (int)this.viewData; //传入的值为第几个活动,不是活动id
|
|
|
- boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index - 1];//是1的时候,就使用轮换活动,不是1就是传入的固定活动
|
|
|
+ int index = (int)this.viewData; //传入的值为第几个活动,不是活动id
|
|
|
+ boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index - 1]; //是1的时候,就使用轮换活动,不是1就是传入的固定活动
|
|
|
}
|
|
|
|
|
|
//新手引导选中第一个活动
|
|
|
- if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0)
|
|
|
+ if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0)
|
|
|
boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
|
|
|
|
|
|
//第二个活动会有许愿活动出现
|
|
|
@@ -183,7 +220,7 @@ namespace GFGGame
|
|
|
if (_activeBoxId > 0)
|
|
|
Timers.inst.Add(1, 0, CheckTime);
|
|
|
//第二个活动的倒计时
|
|
|
- if (actLimitTsyOpen)// && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2
|
|
|
+ if (actLimitTsyOpen) // && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2
|
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
|
|
|
|
//第二个活动的模拟活动倒计时
|
|
|
@@ -199,23 +236,26 @@ namespace GFGGame
|
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
LuckyBoxCfg cfg = CommonDataManager.Tables.TblLuckyBoxCfg.GetOrDefault(boxId);
|
|
|
LuckyBoxDataManager.Instance.InitData(boxId);
|
|
|
- if(!_listActivityBtnObj.ContainsKey(boxId))
|
|
|
- _listActivityBtnObj.Add(boxId,obj);
|
|
|
+ if (!_listActivityBtnObj.ContainsKey(boxId))
|
|
|
+ _listActivityBtnObj.Add(boxId, obj);
|
|
|
else
|
|
|
_listActivityBtnObj[boxId] = obj;
|
|
|
|
|
|
comBox.m_ImgUp.visible = index == 0;
|
|
|
- int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ int activityId =
|
|
|
+ ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
if (activityId > 0 && boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
{
|
|
|
comBox.m_showActivityType.selectedIndex = 1;
|
|
|
UpGiftBox(comBox);
|
|
|
}
|
|
|
- else if (boxId == LuckyBoxDataManager.BOX_ID_2) {
|
|
|
+ else if (boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
+ {
|
|
|
long endTime = TimeUtil.DateTimeToTimestamp(activityEndTime);
|
|
|
if (endTime < TimeHelper.ServerNow())
|
|
|
comBox.m_showActivityType.selectedIndex = 0;
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
comBox.m_showActivityType.selectedIndex = 2;
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
if (endTime >= curTime)
|
|
|
@@ -241,13 +281,16 @@ namespace GFGGame
|
|
|
|
|
|
//comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_txtCost.text = cfg.CostNum.ToString();
|
|
|
- comBox.m_comLuckBoxBtn.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
+ comBox.m_comLuckBoxBtn.m_comCostOne.m_loaCost.url =
|
|
|
+ ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
|
|
|
comBox.m_comLuckBoxBtn.m_comCostTen.m_txtCost.text = cfg.CostNumTen.ToString();
|
|
|
- comBox.m_comLuckBoxBtn.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
+ comBox.m_comLuckBoxBtn.m_comCostTen.m_loaCost.url =
|
|
|
+ ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
|
|
|
comBox.m_comLuckBoxBtn.m_comCostFifty.m_txtCost.text = cfg.CostNumfifty.ToString();
|
|
|
- comBox.m_comLuckBoxBtn.m_comCostFifty.m_loaCost.url = ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
+ comBox.m_comLuckBoxBtn.m_comCostFifty.m_loaCost.url =
|
|
|
+ ResPathUtil.GetCommonGameResPath(CommonDataManager.Tables.TblItemCfg.GetOrDefault(cfg.CostID).Res);
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyOne.data == null)
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyOne.onClick.Add(OnClickBtnBuyOne);
|
|
|
@@ -255,14 +298,38 @@ namespace GFGGame
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyTen.data == null)
|
|
|
{
|
|
|
- if (boxId != LuckyBoxDataManager.BOX_ID_3) {
|
|
|
+ if (boxId != LuckyBoxDataManager.BOX_ID_3)
|
|
|
+ {
|
|
|
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"));
|
|
|
- if(!_effectUIDic.ContainsKey("Button_public" + boxId))
|
|
|
- _effectUIDic.Add("Button_public" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
|
+ {
|
|
|
+ EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox",
|
|
|
+ "Button_Text_DianCang",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUIDic.Add("Button_Text_DianCang" + boxId, effect);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!_effectUIDic.ContainsKey("Button_public" + boxId))
|
|
|
+ {
|
|
|
+ EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox",
|
|
|
+ "Button_public",
|
|
|
+ onComplete: (effect) =>
|
|
|
+ {
|
|
|
+ if (effect != null)
|
|
|
+ {
|
|
|
+ _effectUIDic.Add("Button_public" + boxId, effect);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.onClick.Add(OnClickBtnBuyTen);
|
|
|
}
|
|
|
+
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyFifty.data == null)
|
|
|
@@ -279,6 +346,7 @@ namespace GFGGame
|
|
|
comBox.m_btnShop.target.onClick.Add(OnClikcBtnShop);
|
|
|
comBox.m_btnGiftBag.target.onClick.Add(OnClikcBtnGiftBag);
|
|
|
}
|
|
|
+
|
|
|
comBox.m_btnReward.target.data = boxId;
|
|
|
|
|
|
obj.data = boxId;
|
|
|
@@ -288,9 +356,12 @@ namespace GFGGame
|
|
|
long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
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);
|
|
|
}
|
|
|
+
|
|
|
UI_ComBox1.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
@@ -334,6 +405,7 @@ namespace GFGGame
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
OnListBgScroll();
|
|
|
}
|
|
|
|
|
|
@@ -346,12 +418,15 @@ namespace GFGGame
|
|
|
|
|
|
_curIndex = _ui.m_listBg.GetFirstChildInView();
|
|
|
LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
- if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3) {
|
|
|
+ if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
|
|
|
+ {
|
|
|
_valueBarController.Controller(3);
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
_valueBarController.Controller(4);
|
|
|
}
|
|
|
+
|
|
|
_valueBarController.UpdateCJ();
|
|
|
|
|
|
_luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
@@ -360,6 +435,7 @@ namespace GFGGame
|
|
|
UpdateListItemData();
|
|
|
UpdateEffect();
|
|
|
}
|
|
|
+
|
|
|
private void UpdateEffect()
|
|
|
{
|
|
|
//LuckyBoxCfg luckybox = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
@@ -382,11 +458,14 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateBtnReward()
|
|
|
{
|
|
|
- if (_curIndex == 1) {
|
|
|
+ if (_curIndex == 1)
|
|
|
+ {
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
GObject obj = _listActivityBtnObj[boxId];
|
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
- RedDotController.Instance.SetComRedDot(comBox.m_btnReward.target, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy), "", -21, 18);
|
|
|
+ RedDotController.Instance.SetComRedDot(comBox.m_btnReward.target,
|
|
|
+ RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy), "", -21,
|
|
|
+ 18);
|
|
|
|
|
|
comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
|
|
|
UI_ComBox1.ProxyEnd();
|
|
|
@@ -411,8 +490,10 @@ namespace GFGGame
|
|
|
comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
|
|
|
comBox.m_txtCount.SetVar("name", cfg.Name).FlushVars();
|
|
|
|
|
|
- int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
- var activityInfoByTypeList = ActivityGlobalDataManager.Instance.GetActivityInfoByTypeAndID(ActivityType.XSLB3, activityId);
|
|
|
+ int activityId =
|
|
|
+ ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ var activityInfoByTypeList =
|
|
|
+ ActivityGlobalDataManager.Instance.GetActivityInfoByTypeAndID(ActivityType.XSLB3, activityId);
|
|
|
var list = activityInfoByTypeList.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
|
|
|
if (list.Count == 0)
|
|
|
{
|
|
|
@@ -424,7 +505,8 @@ namespace GFGGame
|
|
|
bool isSoldOut = true;
|
|
|
foreach (var activityInfo in list)
|
|
|
{
|
|
|
- ActivityOpenCfg activityOpenCfg = CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(activityInfo.ActivityId);
|
|
|
+ ActivityOpenCfg activityOpenCfg =
|
|
|
+ CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(activityInfo.ActivityId);
|
|
|
var paramsArr = activityOpenCfg.Params1;
|
|
|
foreach (var shopCfgId in paramsArr)
|
|
|
{
|
|
|
@@ -446,11 +528,13 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- comBox.m_comBagTime.m_txtGiftBagTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
|
|
|
+ comBox.m_comBagTime.m_txtGiftBagTime.text =
|
|
|
+ TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
|
|
|
comBox.m_comBagTime.target.visible = true;
|
|
|
comBox.m_btnGiftBag.target.visible = true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
UpdateBtnReward();
|
|
|
}
|
|
|
|
|
|
@@ -496,7 +580,9 @@ namespace GFGGame
|
|
|
if (textField == null) return;
|
|
|
|
|
|
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);
|
|
|
textField.asTextField.text = string.Format("轮换倒计时:{0}", strTime);
|
|
|
}
|
|
|
|
|
|
@@ -513,6 +599,7 @@ namespace GFGGame
|
|
|
Timers.inst.Remove(UpdateImitateTime);
|
|
|
endTime = curTime;
|
|
|
}
|
|
|
+
|
|
|
textField.asTextField.text = "剩余时间: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
}
|
|
|
|
|
|
@@ -523,7 +610,8 @@ namespace GFGGame
|
|
|
if (item == null) return;
|
|
|
GObject textField = item.asCom.GetChild("txtTsyTime");
|
|
|
if (textField == null) return;
|
|
|
- int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ int activityId =
|
|
|
+ ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
var activityCfg = CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(activityId);
|
|
|
long endTime = 0;
|
|
|
if (activityCfg != null)
|
|
|
@@ -535,6 +623,7 @@ namespace GFGGame
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
endTime = curTime;
|
|
|
}
|
|
|
+
|
|
|
TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
|
|
|
@@ -565,34 +654,40 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
|
- {
|
|
|
- int activityId = 0;
|
|
|
- if (boxId == LuckyBoxDataManager.BOX_ID_2) {
|
|
|
- activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
- }
|
|
|
- bool freeType = (freeTime > 0 && freeTime < TimeHelper.ServerNow());
|
|
|
- bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, freeType, activityId);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- ViewManager.Show<LuckyBoxStarView>();
|
|
|
- LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
|
|
|
- GetSuitItemController.showSingle = false;
|
|
|
- }
|
|
|
- });
|
|
|
+ {
|
|
|
+ int activityId = 0;
|
|
|
+ if (boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
+ {
|
|
|
+ activityId =
|
|
|
+ ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool freeType = (freeTime > 0 && freeTime < TimeHelper.ServerNow());
|
|
|
+ bool result =
|
|
|
+ await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, freeType, activityId);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ ViewManager.Show<LuckyBoxStarView>();
|
|
|
+ LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
|
|
|
+ GetSuitItemController.showSingle = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnBuyTen(EventContext context)
|
|
|
{
|
|
|
GetSuitItemController.showSingle = true;
|
|
|
GuideCfg cfg = CommonDataManager.Tables.TblGuideCfg.GetOrDefault(ConstGuideId.LUCKY_BOX);
|
|
|
- if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0
|
|
|
- && (GuideDataManager.currentGuideId == 0
|
|
|
- || (GuideDataManager.currentGuideId == cfg.Id && GuideDataManager.currentGuideIdIndex != 2)))
|
|
|
+ if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0
|
|
|
+ && (GuideDataManager.currentGuideId == 0
|
|
|
+ || (GuideDataManager.currentGuideId == cfg.Id && GuideDataManager.currentGuideIdIndex != 2)))
|
|
|
{
|
|
|
//防止点击太快,在引导开启前就被点击到,导致引导卡死
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
GObject obj = context.sender as GObject;
|
|
|
int boxId = (int)obj.data;
|
|
|
LuckyBoxCfg luckyBoxCfg = CommonDataManager.Tables.TblLuckyBoxCfg.GetOrDefault(boxId);
|
|
|
@@ -602,14 +697,17 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.TEN_TIME, async () =>
|
|
|
{
|
|
|
int activityId = 0;
|
|
|
if (boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
{
|
|
|
- activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ activityId =
|
|
|
+ ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
}
|
|
|
- bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME,false, activityId);
|
|
|
+
|
|
|
+ bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME, false, activityId);
|
|
|
if (result)
|
|
|
{
|
|
|
ViewManager.Show<LuckyBoxStarView>();
|
|
|
@@ -632,6 +730,7 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.FIFTY_TIME, async () =>
|
|
|
{
|
|
|
bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.FIFTY_TIME, false, 0);
|
|
|
@@ -653,6 +752,7 @@ namespace GFGGame
|
|
|
{
|
|
|
_luckyBoxCtrl[key].OnHide();
|
|
|
}
|
|
|
+
|
|
|
Timers.inst.Remove(CheckTime);
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
Timers.inst.Remove(UpdateImitateTime);
|
|
|
@@ -697,17 +797,18 @@ namespace GFGGame
|
|
|
if (_curIndex > 0) return;
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
GObject gObject = _listActivityBtnObj[boxId];
|
|
|
- if (gObject == null) return;
|
|
|
+ if (gObject == null) return;
|
|
|
GButton btnBuyTen = gObject.asCom.GetChild("comLuckBoxBtn").asCom.GetChild("btnBuyTen").asButton;
|
|
|
- GuideController.TryGuide(null, ConstGuideId.LUCKY_BOX, 1, "“摘星”里可以通过星辰的力量获得服饰。", -1, true, _ui.target.height - 600);
|
|
|
+ GuideController.TryGuide(null, ConstGuideId.LUCKY_BOX, 1, "“摘星”里可以通过星辰的力量获得服饰。", -1, true,
|
|
|
+ _ui.target.height - 600);
|
|
|
GuideController.TryGuide(btnBuyTen, ConstGuideId.LUCKY_BOX, 2, "点击摘取十次。");
|
|
|
- GuideController.TryCompleteGuide( ConstGuideId.LUCKY_BOX, 2);
|
|
|
+ GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX, 2);
|
|
|
}
|
|
|
|
|
|
protected override void TryCompleteGuide()
|
|
|
{
|
|
|
base.TryCompleteGuide();
|
|
|
- // GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX);
|
|
|
+ // GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX);
|
|
|
GuideController.TryCompleteGuideIndex(ConstGuideId.LUCKY_BOX, 2);
|
|
|
}
|
|
|
|
|
|
@@ -740,9 +841,11 @@ namespace GFGGame
|
|
|
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);
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, LuckyBoxDataManager.Instance.RedBtnRight(_curIndex),
|
|
|
+ "", -60, 70);
|
|
|
UI_ComBox1.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
@@ -751,12 +854,13 @@ namespace GFGGame
|
|
|
float offsetY = _ui.m_grpTop.y + ViewGlobal.GetRealTopOffset();
|
|
|
_ui.m_grpTop.SetXY(_ui.m_grpTop.x, offsetY);
|
|
|
}
|
|
|
+
|
|
|
private void UpdateEffectVisible(EventContext eventContext)
|
|
|
{
|
|
|
var resStr = (string)eventContext.data;
|
|
|
- foreach(var item in effectNameDic)
|
|
|
+ foreach (var item in effectNameDic)
|
|
|
{
|
|
|
- if(item.Key == resStr)
|
|
|
+ if (item.Key == resStr)
|
|
|
{
|
|
|
item.Value.visible = true;
|
|
|
}
|