h5sdk提交
This commit is contained in:
@@ -67,11 +67,6 @@ namespace BingoBrain
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
Set101();
|
||||
Set102();
|
||||
SetName();
|
||||
ui.settings.SetClick(OnClickSetting);
|
||||
// ui.com_avatar.loader_flag.visible = false;
|
||||
// if (!GameHelper.IsGiftSwitch() && (ConfigSystem.GetConfig<CommonModel>().WVswitch == 1))
|
||||
// {
|
||||
// ui.btn_h5.visible = true;
|
||||
@@ -83,57 +78,7 @@ namespace BingoBrain
|
||||
// });
|
||||
|
||||
}
|
||||
private void OnClickSetting()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JThinkUI_Open);
|
||||
}
|
||||
|
||||
public void OnUpdate101(object obj = null)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
var changeValue = (decimal)obj;
|
||||
model.show101 += changeValue;
|
||||
model.show101 = Math.Round(model.show101, 2);
|
||||
Set101(model.show101.ToString("N"));
|
||||
}
|
||||
}
|
||||
|
||||
public void Set101(string c101 = null)
|
||||
{
|
||||
if (c101 == null)
|
||||
{
|
||||
c101 = GameHelper.Get101().ToString("N0");
|
||||
}
|
||||
|
||||
ui.btn_coin.title = $"{c101}";
|
||||
}
|
||||
|
||||
public void OnUpdate102(object obj = null)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
var changeValue = (decimal)obj;
|
||||
model.show102 += changeValue;
|
||||
model.show102 = Math.Round(model.show102, 2);
|
||||
Set102(model.show102.ToString("N"));
|
||||
}
|
||||
}
|
||||
|
||||
public void Set102(string c102 = null)
|
||||
{
|
||||
if (c102 == null)
|
||||
{
|
||||
c102 = GameHelper.Get102().ToString("N");
|
||||
}
|
||||
|
||||
ui.btn_cash.title = $"{c102}";
|
||||
}
|
||||
|
||||
private void SetName()
|
||||
{
|
||||
// GameHelper.SetName(ui.com_avatar.text_name);
|
||||
}
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
@@ -145,14 +90,14 @@ namespace BingoBrain
|
||||
protected override void AddListener()
|
||||
{
|
||||
Hall.Instance.AddChangeGiftSwitch(InitView);
|
||||
PreferencesDispatcher<int>.Instance.AddListener(PreferencesMsg.cardBoardSum, SetPLayItem);
|
||||
PreferencesDispatcher<int>.Instance.AddListener(PreferencesMsg.cardBoardSum, CardBoardSumChange);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.RefreshMakeupData, SetMakeup);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
Hall.Instance.RemoveChangeGiftSwitch(InitView);
|
||||
PreferencesDispatcher<int>.Instance.RemoveListener(PreferencesMsg.cardBoardSum, SetPLayItem);
|
||||
PreferencesDispatcher<int>.Instance.RemoveListener(PreferencesMsg.cardBoardSum, CardBoardSumChange);
|
||||
GameDispatcher.Instance.RemoveListener(BingoInfo.RefreshMakeupData, SetMakeup);
|
||||
}
|
||||
|
||||
@@ -190,13 +135,13 @@ namespace BingoBrain
|
||||
ui.com_cardplay.cont_text.selectedIndex = model.CardBoardCountIndex;
|
||||
ui.type.selectedIndex = model.CardBoardCountIndex;
|
||||
ui.btn_ballon.visible = !IsBallonCD;
|
||||
(ui.btn_ballon as btn_balloon).cash_text.text = $" {GameHelper.GetDynamicReward(102, GameHelper.GetCommonModel().ballonReward102):N}";
|
||||
ui.btn_ballon.SetClick(OnClickBalloon);
|
||||
ui.btn_ballon.sortingOrder = 100;
|
||||
|
||||
MoveToOtherSide();
|
||||
Hall.Instance.UpdateSecondEvent += UpdateSecond;
|
||||
UpdateSecond();
|
||||
// CardBoardSumChange(null);
|
||||
CardBoardSumChange(null);
|
||||
UpdateNextCardBoardTime();
|
||||
ui.com_cards.SetClick(() =>
|
||||
{
|
||||
@@ -229,47 +174,43 @@ namespace BingoBrain
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.FaqUIUI_Open);
|
||||
});
|
||||
play_item_list.Add(ui.com_mainplay.play_item0);
|
||||
play_item_list.Add(ui.com_mainplay.play_item1);
|
||||
play_item_list.Add(ui.com_mainplay.play_item2);
|
||||
SetPLayItem();
|
||||
ui.com_mainplay.btn_right.SetClick(() =>
|
||||
// ui.btn_cashout.SetClick(() =>
|
||||
// {
|
||||
// var makeupTaskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
|
||||
// var vo = ConfigSystem.GetConfig<MakeupModel>().GetData(makeupTaskData.tableId);
|
||||
// //DataMgr.Ticket.Value=99999;
|
||||
// //makeupTaskData.videoCount = 50;
|
||||
// if (vo == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// UICtrlDispatcher.Instance.Dispatch(SkinInfo.MakeupConfirmUI_Open, makeupTaskData);
|
||||
// });
|
||||
ui.btn_saveingpot.SetClick(() =>
|
||||
{
|
||||
|
||||
var first1 = play_index_list[0];
|
||||
play_index_list.RemoveAt(0);
|
||||
play_index_list.Add(first1);
|
||||
SetPLayItem();
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.SaveingPotUI_Open);
|
||||
});
|
||||
ui.com_mainplay.btn_left.SetClick(() =>
|
||||
ui.btn_petty.SetClick(() =>
|
||||
{
|
||||
|
||||
var last = play_index_list[play_index_list.Count - 1];
|
||||
play_index_list.RemoveAt(play_index_list.Count - 1);
|
||||
play_index_list.Insert(0, last);
|
||||
|
||||
SetPLayItem();
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.PettyAwardUI_Open);
|
||||
});
|
||||
|
||||
ui.btn_task.SetClick(() =>
|
||||
ui.btn_wb.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.MissionUI_Open);
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.H5UI_Open);
|
||||
});
|
||||
ui.btn_wheel.SetClick(() =>
|
||||
if (SaveData.GetSaveobject().PettyState == 0 && GameHelper.IsGiftSwitch()) UICtrlDispatcher.Instance.Dispatch(SkinInfo.PettyAwardUI_Open);
|
||||
if (GameHelper.IsGiftSwitch() || (ConfigSystem.GetConfig<CommonModel>().WVswitch == 1))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.BingoToyUI_Open);
|
||||
});
|
||||
ui.btn_sign.SetClick(() =>
|
||||
ui.btn_wb.visible = true;
|
||||
}
|
||||
if (GameHelper.GetCommonModel().PiggyBankSwitch != 1) ui.btn_saveingpot.visible = false;
|
||||
Debug.Log(JsonConvert.SerializeObject(GameHelper.GetConfig<AdRewardModel>().dataList));
|
||||
ui.btn_pal.SetClick(() =>
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTodUI_Open);
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.PalUI_Open);
|
||||
});
|
||||
model.show101 = GameHelper.Get101();
|
||||
model.show102 = GameHelper.Get102();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void UpdateNextCardBoardTime()
|
||||
{
|
||||
if (ui.com_cards.text_time.visible)
|
||||
@@ -294,12 +235,6 @@ namespace BingoBrain
|
||||
}
|
||||
|
||||
ui.com_cards.text_num.text = GameHelper.GetNoDecimalUnitStr(PreferencesMgr.Instance.CardBoardSum);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -309,144 +244,64 @@ namespace BingoBrain
|
||||
|
||||
void MoveToOtherSide()
|
||||
{
|
||||
// if (waitTween != null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
if (waitTween != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// isLeft = !isLeft;
|
||||
// if (!ui.btn_ballon.visible)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
isLeft = !isLeft;
|
||||
if (!ui.btn_ballon.visible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!isMoveFinish)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
if (!isMoveFinish)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// var targetPos = isLeft ? StartPos : FinalPos;
|
||||
// float offset = 300;
|
||||
// targetPos.y = Random.Range(BingoCell.CenterUIPos.y - offset, BingoCell.CenterUIPos.y + offset);
|
||||
// isMoveFinish = false;
|
||||
// var tw = ui.btn_ballon.TweenMove(targetPos, moveTime).OnComplete(() =>
|
||||
// {
|
||||
// isMoveFinish = true;
|
||||
// ui.btn_ballon.InvalidateBatchingState();
|
||||
// float waitTime = Random.Range(5, 11);
|
||||
// waitTween = DOVirtual.DelayedCall(waitTime, () =>
|
||||
// {
|
||||
// waitTween = null;
|
||||
// MoveToOtherSide();
|
||||
// });
|
||||
// tweenerQueue.Enqueue(waitTween);
|
||||
// });
|
||||
// gtweenerQueue.Enqueue(tw);
|
||||
var targetPos = isLeft ? StartPos : FinalPos;
|
||||
float offset = 300;
|
||||
targetPos.y = Random.Range(BingoCell.CenterUIPos.y - offset, BingoCell.CenterUIPos.y + offset);
|
||||
isMoveFinish = false;
|
||||
var tw = ui.btn_ballon.TweenMove(targetPos, moveTime).OnComplete(() =>
|
||||
{
|
||||
isMoveFinish = true;
|
||||
ui.btn_ballon.InvalidateBatchingState();
|
||||
float waitTime = Random.Range(5, 11);
|
||||
waitTween = DOVirtual.DelayedCall(waitTime, () =>
|
||||
{
|
||||
waitTween = null;
|
||||
MoveToOtherSide();
|
||||
});
|
||||
tweenerQueue.Enqueue(waitTween);
|
||||
});
|
||||
gtweenerQueue.Enqueue(tw);
|
||||
}
|
||||
|
||||
private void UpdateSecond()
|
||||
{
|
||||
// if (!Hall.Instance.IsGaming())
|
||||
// {
|
||||
// if (ui != null && ui.btn_ballon != null)
|
||||
// {
|
||||
// if (ui.btn_ballon.visible != !IsBallonCD)
|
||||
// {
|
||||
// ui.btn_ballon.visible = !IsBallonCD;
|
||||
// // 开始移动
|
||||
// if (ui.btn_ballon.visible)
|
||||
// {
|
||||
// MoveToOtherSide();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// UpdateNextCardBoardTime();
|
||||
|
||||
ui.btn_wheel.image_red.visible = IsCanLuckyWheel();
|
||||
ui.btn_task.image_red.visible = IsCanDailyTask();
|
||||
ui.btn_sign.image_red.visible = IsCanSignIn();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private bool IsCanSignIn()
|
||||
{
|
||||
return GameHelper.IsCanSignInToday();
|
||||
}
|
||||
|
||||
private bool IsCanLuckyWheel()
|
||||
{
|
||||
return GameHelper.GetNowTime() >= PreferencesMgr.Instance.NextOpenWheelStampTime;
|
||||
}
|
||||
|
||||
internal bool IsCanDailyTask()
|
||||
{
|
||||
bool hasActiveMission = false;
|
||||
for (int i = 0; i < PreferencesMgr.Instance.ActiveMissions.Count; i++)
|
||||
if (!Hall.Instance.IsGaming())
|
||||
{
|
||||
if (!PreferencesMgr.Instance.ActiveMissions[i].IsReward && PreferencesMgr.Instance.ActiveMissions[i].Progress >= PreferencesMgr.Instance.ActiveMissions[i].MaxProgress)
|
||||
if (ui != null && ui.btn_ballon != null)
|
||||
{
|
||||
hasActiveMission = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return hasActiveMission;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<com_mainplayitem> play_item_list = new List<com_mainplayitem>();
|
||||
private List<int> play_index_list = new List<int>() { 0, 1, 2 };
|
||||
private static int[] cardBoardNumList = new[]
|
||||
{
|
||||
1, 2, 4
|
||||
};
|
||||
private void SetPLayItem(object a = null)
|
||||
{
|
||||
if (play_item_list == null || play_index_list == null) return;
|
||||
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
int i = j;
|
||||
play_item_list[i].type.selectedIndex = play_index_list[i];
|
||||
play_item_list[i].text_now.text = PreferencesMgr.Instance.CardBoardSum + "/";
|
||||
int need_card = cardBoardNumList[play_index_list[i]];
|
||||
play_item_list[i].text_need.text = need_card.ToString();
|
||||
if (PreferencesMgr.Instance.CardBoardSum < need_card)
|
||||
{
|
||||
play_item_list[i].can_play.selectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
play_item_list[i].can_play.selectedIndex = 1;
|
||||
}
|
||||
|
||||
play_item_list[i].btn_play.SetClick(() =>
|
||||
{
|
||||
if (PreferencesMgr.Instance.CardBoardSum >= need_card)
|
||||
if (ui.btn_ballon.visible != !IsBallonCD)
|
||||
{
|
||||
PreferencesMgr.Instance.CardBoardSum -= need_card;
|
||||
PreferencesMgr.Instance.CardBoardIndex = play_index_list[i];
|
||||
ui.com_cards.text_fx.text = $"-{need_card}";
|
||||
ui.touchable = false;
|
||||
ui.com_cards.fx_num.Play();
|
||||
DOVirtual.DelayedCall(ui.com_cards.fx_num.totalDuration / 2, () =>
|
||||
ui.btn_ballon.visible = !IsBallonCD;
|
||||
// 开始移动
|
||||
if (ui.btn_ballon.visible)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(SkinInfo.SmailUI_Close);
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.StartBingoGame);
|
||||
});
|
||||
MoveToOtherSide();
|
||||
(ui.btn_ballon as btn_balloon).cash_text.text = $" {GameHelper.GetDynamicReward(102, GameHelper.GetCommonModel().ballonReward102):N}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(SkinInfo.MoreCardUI_Open);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
UpdateNextCardBoardTime();
|
||||
}
|
||||
|
||||
|
||||
private void OnClickBalloon()
|
||||
{
|
||||
if (BingoCell.isProcedure || BingoCell.IsGuiding)
|
||||
@@ -476,7 +331,7 @@ namespace BingoBrain
|
||||
{
|
||||
ui.btn_ballon.touchable = true;
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.RefreshMakeupData);
|
||||
}, ui.btn_ballon, GameHelper.IsGiftSwitch() ? ui.makeup.cash_text : null);
|
||||
}, ui.btn_ballon);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -628,7 +483,7 @@ namespace BingoBrain
|
||||
}
|
||||
void SetMakeup(object a = null)
|
||||
{
|
||||
if (!GameHelper.IsGiftSwitch()) return;
|
||||
return;
|
||||
// var com_box = ui.com_box;
|
||||
// com_box.cont_white.selectedIndex =
|
||||
// GameHelper.IsGiftSwitch() ? com_box._White_none : com_box._White_white;
|
||||
@@ -673,11 +528,11 @@ namespace BingoBrain
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency102, 1,
|
||||
value => { ui.makeup.cash_text.text = value.ToString("0.00"); });
|
||||
// DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency102, 1,
|
||||
// value => { ui.makeup.cash_text.text = value.ToString("0.00"); });
|
||||
|
||||
ui.makeup.cash_progress_text.text = PreferencesMgr.Instance.Currency102 + "/" + vo.item_need;
|
||||
ui.makeup.cash_progress.value = ((float)PreferencesMgr.Instance.Currency102 * 100) / vo.item_need;
|
||||
// ui.makeup.cash_progress_text.text = PreferencesMgr.Instance.Currency102 + "/" + vo.item_need;
|
||||
// ui.makeup.cash_progress.value = ((float)PreferencesMgr.Instance.Currency102 * 100) / vo.item_need;
|
||||
// var leftCash = (double)Math.Max(vo.item_need - PreferencesMgr.Instance.Currency101, 0);
|
||||
// com_box.text_more.SetVar("left", GameHelper.Get101Str((decimal)leftCash)).FlushVars();
|
||||
// com_box.pb_num.max = vo.item_need;
|
||||
|
||||
Reference in New Issue
Block a user