fix:1、修复bug
This commit is contained in:
@@ -9,6 +9,7 @@ using FGUI.Arrow_game;
|
||||
using FGUI.Common_01;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
using btn_saveingpot = FGUI.Common_01.btn_saveingpot;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace ChillConnect
|
||||
@@ -347,6 +348,17 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.panel.y += Screen.safeArea.y - 15;
|
||||
ui.com_money.y += Screen.safeArea.y- 15;
|
||||
ui.com_gem.y += Screen.safeArea.y - 15;
|
||||
ui.btn_signin.y += Screen.safeArea.y - 15;
|
||||
}
|
||||
|
||||
ui.state.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
|
||||
|
||||
|
||||
//加载配置
|
||||
// InitAllLevelData();
|
||||
LoadLevelConfig();
|
||||
@@ -365,6 +377,48 @@ namespace ChillConnect
|
||||
InitView();
|
||||
|
||||
((com_money)ui.com_money).btn_ch.title = GameHelper.getDesByKey("ch_out_1");
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
|
||||
{
|
||||
ui.btn_saveingpot.visible = true;
|
||||
ui.com_gift.visible = true;
|
||||
}
|
||||
|
||||
GameHelper.IsShowFirstReward();
|
||||
|
||||
GameHelper.ShowStatementView();
|
||||
}
|
||||
|
||||
private void RefreshGift(object obj = null)
|
||||
{
|
||||
ui.com_gift.text_gift.text = GameHelper.Get102Str((decimal)SaveData.GetSaveObject().saveingpot_ch);
|
||||
}
|
||||
|
||||
private void Set101(decimal coin = -1)
|
||||
{
|
||||
if (coin < 0)
|
||||
{
|
||||
coin = DataMgr.Coin.Value;
|
||||
}
|
||||
|
||||
if (ui.com_gem is com_gold btnCoin) btnCoin.text_gold.text = $"{coin:N0}";
|
||||
}
|
||||
|
||||
private void Set102()
|
||||
{
|
||||
decimal coin = DataMgr.Ticket.Value;
|
||||
|
||||
if (ui.com_money is com_money comMoney) comMoney.text_gold.text = coin.ToString("0.00");
|
||||
}
|
||||
|
||||
public void OnUpdate101(object obj = null)
|
||||
{
|
||||
Set101();
|
||||
}
|
||||
|
||||
public void OnUpdate102(object obj = null)
|
||||
{
|
||||
Set102();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
@@ -390,6 +444,7 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UseProps, SetUserPorp);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.StopArrowTouch,OpenOrStopGameInput);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.refreshGift,RefreshGift);
|
||||
|
||||
}
|
||||
|
||||
@@ -402,6 +457,8 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UseProps, SetUserPorp);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.StopArrowTouch, OpenOrStopGameInput);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.refreshGift,RefreshGift);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -487,6 +544,10 @@ namespace ChillConnect
|
||||
SetModel();
|
||||
|
||||
SetTopCurr();
|
||||
|
||||
Set101();
|
||||
|
||||
RefreshGift();
|
||||
|
||||
_fingerTipObj = com_finger.CreateInstance();
|
||||
_viewContainer.AddChild(_fingerTipObj);
|
||||
@@ -563,6 +624,12 @@ namespace ChillConnect
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.PersonViewUI_Open, _moveSpeed);
|
||||
});
|
||||
|
||||
if (!GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().WVswitch == 0)
|
||||
{
|
||||
ui.btn_wv.visible = false;
|
||||
}
|
||||
ui.btn_wv.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.H5UI_Open); });
|
||||
|
||||
ui.com_bottom.btn_skin.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.ArrowThemeUI_Open); });
|
||||
|
||||
ui.btn_petty.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.PettyAwardUI_Open); });
|
||||
@@ -572,6 +639,8 @@ namespace ChillConnect
|
||||
ui.btn_statement.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.StatementViewUI_Open); });
|
||||
|
||||
ui.btn_saveingpot.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
|
||||
ui.com_gift.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
}
|
||||
|
||||
|
||||
@@ -1883,12 +1952,15 @@ namespace ChillConnect
|
||||
/// </summary>
|
||||
private void DisappearLineGetReward()
|
||||
{
|
||||
|
||||
if (!GameHelper.IsGiftSwitch()) return;
|
||||
|
||||
bool isGet = false;
|
||||
|
||||
int money_rate = ConfigSystem.GetConfig<CommonModel>().rewardrate;
|
||||
var randomNum = UnityEngine.Random.Range(0, 100);
|
||||
// Debug.Log($"[creat] money_rate------------ {randomNum}==={money_rate}");
|
||||
if (GameHelper.IsGiftSwitch() && randomNum < money_rate)
|
||||
if (randomNum < money_rate)
|
||||
{
|
||||
isGet = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user