From d95ce828ba5869d39beb9de2bce3f7e577d5bc57 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Mon, 18 Nov 2024 17:42:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E6=B3=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scenes/Battle_Royale.unity | 4 +++- .../Scripts/Battle_Royale/AllHouseContro.cs | 4 ++-- .../Assets/Scripts/Battle_Royale/BettingBtn.cs | 12 ++++++++++++ .../Assets/Scripts/Battle_Royale/HouseBtn.cs | 7 +++++-- .../Assets/Scripts/Login/UI/logoPanel.cs | 18 +++++++++--------- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity index 8d6d29e..7d18ab8 100644 --- a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity +++ b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity @@ -1800,6 +1800,7 @@ MonoBehaviour: warnPanel: {fileID: 1807910154} wonnius: [] allother: {fileID: 716344324} + HaveallotherMove: 0 is_jisha: 0 is_jisha_jiesuan: 0 --- !u!114 &142654724 @@ -2182,7 +2183,8 @@ MonoBehaviour: m_EditorClassIdentifier: Money: 1000 AllBetCoins: 0 - SelfWoniuText: {fileID: 0} + SelfWoniuText: {fileID: 1046374311} + HaveBet: 0 --- !u!1 &197030554 GameObject: m_ObjectHideFlags: 0 diff --git a/TheStrongestSnail/Assets/Scripts/Battle_Royale/AllHouseContro.cs b/TheStrongestSnail/Assets/Scripts/Battle_Royale/AllHouseContro.cs index c9d555e..6e25f4b 100644 --- a/TheStrongestSnail/Assets/Scripts/Battle_Royale/AllHouseContro.cs +++ b/TheStrongestSnail/Assets/Scripts/Battle_Royale/AllHouseContro.cs @@ -104,10 +104,10 @@ public class AllHouseContro : MonoBehaviour } else if (serverResponse.data.carrySeconds < 45){ ControAllDoorOpen(); - text.GetComponentInChildren().text = (60 - serverResponse.data.carrySeconds).ToString(); + text.GetComponentInChildren().text = (45 - serverResponse.data.carrySeconds).ToString(); detailsText.GetComponentInChildren().text = "秒后霸主出现"; await Task.Delay(1000); - text.GetComponentInChildren().text = (60 - serverResponse.data.carrySeconds - 1).ToString(); + text.GetComponentInChildren().text = (45 - serverResponse.data.carrySeconds - 1).ToString(); if (!HaveallotherMove) diff --git a/TheStrongestSnail/Assets/Scripts/Battle_Royale/BettingBtn.cs b/TheStrongestSnail/Assets/Scripts/Battle_Royale/BettingBtn.cs index 77f8142..7d3b95d 100644 --- a/TheStrongestSnail/Assets/Scripts/Battle_Royale/BettingBtn.cs +++ b/TheStrongestSnail/Assets/Scripts/Battle_Royale/BettingBtn.cs @@ -70,7 +70,19 @@ public class BettingBtn : MonoBehaviour bg.GetComponentInChildren().battleRoyaleGameDetails(); } + public async void BetAgain() + { + RequestData body = new RequestData(); + body.escapeId = bg.GetComponentInChildren().escapeId; + body.bet = PlayerInfo.instance.AllBetCoins; + body.roomNo = bg.GetComponentInChildren().roomNo; + body.userId = Global.global.serverResponse.data.userId; + + string response = await web.SendRequest(web.URL + "/snail/gameEscape/userBet", "POST", JsonUtility.ToJson(body), Global.global.CreateHeaders()); + Debug.Log("用户下注响应: " + response); + bg.GetComponentInChildren().battleRoyaleGameDetails(); + } void SetBet() { diff --git a/TheStrongestSnail/Assets/Scripts/Battle_Royale/HouseBtn.cs b/TheStrongestSnail/Assets/Scripts/Battle_Royale/HouseBtn.cs index 4d1949b..2db5e4c 100644 --- a/TheStrongestSnail/Assets/Scripts/Battle_Royale/HouseBtn.cs +++ b/TheStrongestSnail/Assets/Scripts/Battle_Royale/HouseBtn.cs @@ -38,8 +38,11 @@ public class HouseBtn : MonoBehaviour transform.GetComponent().StartMove(); woniuMovePos.HadChoise = true; } - - + + if (PlayerInfo.instance.HaveBet) + { + BettingBtn.instance.BetAgain();//再次投注,换房子 + } } } diff --git a/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs b/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs index 37b797d..3fe0ba0 100644 --- a/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs +++ b/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs @@ -85,18 +85,18 @@ public class logoPanel : MonoBehaviour public async void OnClickLoginBtnAsync() { - //loginbody body = new loginbody - //{ - // userName = userNameField.text, - // password = passwordField.text, - // verifyCode = int.Parse(verifyCodeField.text) - //}; loginbody body = new loginbody { - userName = "15151658596", - password = "123456", - verifyCode = 111111 + userName = userNameField.text, + password = passwordField.text, + verifyCode = int.Parse(verifyCodeField.text) }; + //loginbody body = new loginbody + //{ + // userName = "15151658596", + // password = "123456", + // verifyCode = 111111 + //}; string loginResponse = await web.SendRequest(web.URL+"/snail/user/login", "POST", JsonUtility.ToJson(body)); ServerResponse response = JsonUtility.FromJson(loginResponse); if (response != null && response.code == 200 && response.data != null)