From 779c57a1874cd0c0d5caef358731a387e257defb Mon Sep 17 00:00:00 2001 From: hyskai <2545507770@qq.com> Date: Tue, 5 Nov 2024 02:01:38 +0800 Subject: [PATCH 1/2] add --- .../cultivation_Jinsha_mine_slices.unity | 21 +++++++----- .../Assets/script/ConnactServer/JinShaBuy.cs | 8 ++++- .../RoomJinsha.cs | 33 ++++++++++++++----- .../cultivation_Jinsha_mine_slices/jinsha.cs | 2 +- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/meng_yao/Assets/Scenes/cultivation_Jinsha_mine_slices.unity b/meng_yao/Assets/Scenes/cultivation_Jinsha_mine_slices.unity index f7e27b460..efdb7b01a 100644 --- a/meng_yao/Assets/Scenes/cultivation_Jinsha_mine_slices.unity +++ b/meng_yao/Assets/Scenes/cultivation_Jinsha_mine_slices.unity @@ -706,11 +706,11 @@ MonoBehaviour: m_EditorClassIdentifier: go: {fileID: 109717923} icons: - - {fileID: -564534321, guid: c0603bed087587a459e19f661e80a9b3, type: 3} - - {fileID: 681606087, guid: 239c172bda433554e8dd76bb66b20796, type: 3} - - {fileID: -1747828919, guid: 17e3fe66824e3524bbe9cdd2e3327c17, type: 3} - - {fileID: 1678500488, guid: 77b6288ddba3e0e449fdbd9840862b54, type: 3} - {fileID: 2074926565, guid: 67d2b1db3ae59284d89e1bdadb1945aa, type: 3} + - {fileID: -564534321, guid: c0603bed087587a459e19f661e80a9b3, type: 3} + - {fileID: -1747828919, guid: 17e3fe66824e3524bbe9cdd2e3327c17, type: 3} + - {fileID: 681606087, guid: 239c172bda433554e8dd76bb66b20796, type: 3} + - {fileID: 1678500488, guid: 77b6288ddba3e0e449fdbd9840862b54, type: 3} toolsicons: - {fileID: 21300000, guid: d4fbb32ff8543d443b74de2652100618, type: 3} - {fileID: 21300000, guid: f6884187fb833964ea9e632b9d5a8252, type: 3} @@ -2180,7 +2180,7 @@ MonoBehaviour: maxNumer: 10 haveNumber: 0 type: 0 - buy_type: 0 + buy_type: 1 toolsNumber: 0 haveNumber_text: {fileID: 1337763590} toolsNumber_text: {fileID: 1489572594} @@ -2196,6 +2196,7 @@ MonoBehaviour: - {fileID: 1206549371} BlackRoom: {fileID: 982477524} Boom: {fileID: 1998930180334184709, guid: 1af55f3362cdbd643937d48b138bef77, type: 3} + ids: [] --- !u!1 &379972120 GameObject: m_ObjectHideFlags: 0 @@ -5917,7 +5918,7 @@ MonoBehaviour: maxNumer: 10 haveNumber: 0 type: 2 - buy_type: 0 + buy_type: 2 toolsNumber: 0 haveNumber_text: {fileID: 889190687} toolsNumber_text: {fileID: 1983841859} @@ -5933,6 +5934,7 @@ MonoBehaviour: - {fileID: 1675356532} BlackRoom: {fileID: 314702314} Boom: {fileID: 1998930180334184709, guid: 1af55f3362cdbd643937d48b138bef77, type: 3} + ids: [] --- !u!1 &1058917053 GameObject: m_ObjectHideFlags: 0 @@ -7042,7 +7044,7 @@ MonoBehaviour: maxNumer: 10 haveNumber: 0 type: 4 - buy_type: 0 + buy_type: 3 toolsNumber: 0 haveNumber_text: {fileID: 1512878292} toolsNumber_text: {fileID: 1696745609} @@ -7058,6 +7060,7 @@ MonoBehaviour: - {fileID: 331442506} BlackRoom: {fileID: 64041271} Boom: {fileID: 1998930180334184709, guid: 1af55f3362cdbd643937d48b138bef77, type: 3} + ids: [] --- !u!1 &1267245798 GameObject: m_ObjectHideFlags: 0 @@ -10181,6 +10184,7 @@ MonoBehaviour: - {fileID: 1954144235} BlackRoom: {fileID: 927504749} Boom: {fileID: 1998930180334184709, guid: 1af55f3362cdbd643937d48b138bef77, type: 3} + ids: [] --- !u!1 &1625551201 GameObject: m_ObjectHideFlags: 0 @@ -10868,7 +10872,7 @@ MonoBehaviour: maxNumer: 10 haveNumber: 0 type: 6 - buy_type: 0 + buy_type: 5 toolsNumber: 0 haveNumber_text: {fileID: 1526054076} toolsNumber_text: {fileID: 1867062610} @@ -10884,6 +10888,7 @@ MonoBehaviour: - {fileID: 234795530} BlackRoom: {fileID: 1676301279} Boom: {fileID: 1998930180334184709, guid: 1af55f3362cdbd643937d48b138bef77, type: 3} + ids: [] --- !u!1 &1747948505 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs index 594c41775..ed08c197a 100644 --- a/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs +++ b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs @@ -125,11 +125,16 @@ public class JinShaBuy : mount generateForFisherElf.Num = Num; generateForFisherElf.Count = Convert.ToInt32(number); string response = await web.SendRequest(web.URL + "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf)); + + Mining_Wizard_ID data = JsonUtility.FromJson(response); Promptmgr.Instance.PromptBubble("购买精灵成功", Color.black,Color.blue); int index1 = Num - 1; int index2 = (Num - 1)*2; - rooms[index1].GetComponent().addman(index2, number); + rooms[index1].GetComponent().addman(index2, number); + Debug.Log(data.Ids[0]); + rooms[index1].GetComponent().ids.Add(data.Ids[0]); + } else { @@ -144,6 +149,7 @@ public class JinShaBuy : mount int index1 = Num - 74; int index2 = (Num - 74)*2; rooms[index1].GetComponent().addtools(index2, number); + // rooms[index1].GetComponent().toolids.Add(); } } }); diff --git a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/RoomJinsha.cs b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/RoomJinsha.cs index cc881bc4b..9e1dd48fa 100644 --- a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/RoomJinsha.cs +++ b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/RoomJinsha.cs @@ -29,6 +29,9 @@ public class RoomJinsha : mount private bool Buy_succefful = false; public static bool Can = true; + + public List ids =new List(); + public List toolids = new List(); // Start is called before the first frame update public override void Awake() { @@ -81,6 +84,8 @@ public class RoomJinsha : mount } + UseDaijinjuan(); + haveNumber--; toolsNumber--; UpdateShowCazhi(); @@ -122,10 +127,12 @@ public class RoomJinsha : mount Promptmgr.Instance.PromptBubble("购买卷不足", Color.black, Color.red); return; } - PlayerManager.Instance.SetMoney(MoneyType.Stones, -10); + //PlayerManager.Instance.SetMoney(MoneyType.Stones, -10); } - - + + //Use uesminer = new Use(); + + UseDaijinjuan(); GetRoom(); haveNumber--; @@ -162,9 +169,9 @@ public class RoomJinsha : mount public void addman(int type, int num) { - Debug.LogError("======================="); + /*Debug.LogError("======================="); Debug.LogError(type); - Debug.LogError(this.type); + Debug.LogError(this.type);*/ if (type == this.type) { Debug.Log("扣钱检测"); @@ -199,9 +206,9 @@ public class RoomJinsha : mount public void addtools(int type, int num) { - Debug.LogError("======================="); + /* Debug.LogError("======================="); Debug.LogError(type); - Debug.LogError(this.type); + Debug.LogError(this.type);*/ if (type == this.type) { Debug.LogError("111111111111111111111111111"); @@ -257,10 +264,18 @@ public class RoomJinsha : mount itemlist.Add(reslist.List[i]); } } - - } + private async void UseDaijinjuan() + { + Use use = new Use(); + use.Id = ids[ids.Count-1]; + ids.RemoveAt(ids.Count - 1); + string jsonString = JsonUtility.ToJson(use); + string aa = await web.SendRequest(web.URL + "/Voucher/Use", "POST", jsonString); + Debug.Log(aa); + + } //开拓房间 diff --git a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/jinsha.cs b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/jinsha.cs index 754b1a61e..3a61e2d47 100644 --- a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/jinsha.cs +++ b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/jinsha.cs @@ -51,7 +51,7 @@ public class jinsha : mount public async void buy_miners()//购买金币矿工界面 { - + loding(); // loding(); //关闭摄像头逻辑 From 2dc8687b049432f184750a1bece0d5b2868262a8 Mon Sep 17 00:00:00 2001 From: hyskai <2545507770@qq.com> Date: Tue, 5 Nov 2024 03:17:56 +0800 Subject: [PATCH 2/2] add --- .../cultivation_Jinsha_mine_slices/room.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs index 64e9942f4..14273cf83 100644 --- a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs +++ b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs @@ -110,22 +110,7 @@ public class room : mount private async void OnMouseDown() { - /* if (haveNumber<1||toolsNumber<1) - { - Promptmgr.Instance.PromptBubble("人数或工具不足", Color.black, Color.red); - return; - }*/ - - /*if (toolsNumber_text == null) - { - Debug.Log("扣钱检测"); - if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11) - { - Promptmgr.Instance.PromptBubble("购买卷不足", Color.black, Color.red); - return; - } - }*/ Generate(1); GetRoom(); haveNumber++; @@ -249,8 +234,7 @@ public class room : mount use.Id = data.Ids[0]; string jsonString = JsonUtility.ToJson(use); Debug.Log(jsonString); - string aa = await web.SendRequest(web.URL + "/Voucher/Use", "POST", jsonString); - Debug.Log(aa); + string aa = await web.SendRequest(web.URL + "/Voucher/Use", "POST", jsonString); }