This commit is contained in:
hyskai 2024-11-05 05:11:14 +08:00
parent 86ef0039d5
commit 5b209726fa
5 changed files with 35 additions and 7 deletions

View File

@ -716,6 +716,12 @@ MonoBehaviour:
- {fileID: 21300000, guid: f6884187fb833964ea9e632b9d5a8252, type: 3} - {fileID: 21300000, guid: f6884187fb833964ea9e632b9d5a8252, type: 3}
- {fileID: 21300000, guid: f79faf75d4e26b748958aaaf6c64cf56, type: 3} - {fileID: 21300000, guid: f79faf75d4e26b748958aaaf6c64cf56, type: 3}
Thingid: Thingid:
rooms:
- {fileID: 361643069}
- {fileID: 1026708935}
- {fileID: 1262522313}
- {fileID: 1737182421}
- {fileID: 1625391898}
type: 0 type: 0
--- !u!114 &109717923 --- !u!114 &109717923
MonoBehaviour: MonoBehaviour:

View File

@ -130,6 +130,7 @@ public class Giveaway //
[Serializable] [Serializable]
public class AllVocherItem //所有代金卷数据 public class AllVocherItem //所有代金卷数据
{ {
@ -210,6 +211,8 @@ public class ids:Res
} }
[Serializable] [Serializable]
public class ItmeBuy//购买道具 public class ItmeBuy//购买道具
{ {

View File

@ -132,7 +132,7 @@ public class JinShaBuy : mount
int index1 = Num - 1; int index1 = Num - 1;
int index2 = (Num - 1)*2; int index2 = (Num - 1)*2;
rooms[index1].GetComponent<RoomJinsha>().addman(index2, number); rooms[index1].GetComponent<RoomJinsha>().addman(index2, number);
Debug.Log(data.Ids[0]); //Debug.Log(data.Ids[0]);
rooms[index1].GetComponent<RoomJinsha>().ids.Add(data.Ids[0]); rooms[index1].GetComponent<RoomJinsha>().ids.Add(data.Ids[0]);
} }

View File

@ -250,7 +250,7 @@ public class RoomJinsha : mount
string sponse = await web.SendRequest(web.URL + "/MinerElf/GetList", "POST"); string sponse = await web.SendRequest(web.URL + "/MinerElf/GetList", "POST");
Debug.Log(sponse); //Debug.Log(sponse);
string response = await web.SendRequest(web.URL + "/MinerElfActive/GetListOfGem", "POST"); string response = await web.SendRequest(web.URL + "/MinerElfActive/GetListOfGem", "POST");

View File

@ -19,7 +19,9 @@ public class jinsha : mount
private string userid;//赠送对象id private string userid;//赠送对象id
public string Thingid; //ÔùËÍÎïÆ·id public int Thingid; //房间的索引
public List<GameObject> rooms = new List<GameObject>();
public override void Awake() public override void Awake()
{ {
intance = this; intance = this;
@ -105,7 +107,7 @@ public class jinsha : mount
{ {
Item item = intData.GetTypedData(); Item item = intData.GetTypedData();
Thingid = item.Id.ToString(); Thingid = item.Num;
go.Show_buy(boxType.icon, boxType.prompt, 64, item.Num, item.ActivateValue); go.Show_buy(boxType.icon, boxType.prompt, 64, item.Num, item.ActivateValue);
} }
@ -151,13 +153,13 @@ public class jinsha : mount
{ {
item.GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) => item.GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>
{ {
Debug.Log(boxType.customData); //Debug.Log(boxType.customData);
if (boxType.customData is BoxData<PlayerData> intData)//通过储存的泛型来查找挖矿精灵对应的item数据 if (boxType.customData is BoxData<PlayerData> intData)//通过储存的泛型来查找挖矿精灵对应的item数据
{ {
PlayerData pldata = intData.GetTypedData(); PlayerData pldata = intData.GetTypedData();
userid = pldata.Id; userid = pldata.Id;
Debug.Log(pldata.Id); //Debug.Log(pldata.Id);
} }
List<BoxType> boxTypeser = new List<BoxType>(); List<BoxType> boxTypeser = new List<BoxType>();
@ -171,6 +173,20 @@ public class jinsha : mount
if (type == 1) if (type == 1)
{ {
//赠送逻辑 //赠送逻辑
Giveaway giveaway = new Giveaway();
Debug.LogError(Thingid);
List<string> go = rooms[Thingid].GetComponent<RoomJinsha>().ids;
Debug.LogError(rooms[Thingid].GetComponent<RoomJinsha>().ids);
if (go.Count<1)
{
Debug.LogError("你还没有");
ercitanchuang.GetComponent<input_box_pop_up_window>().destroy();
return;
}
giveaway.Ids[0] = go[go.Count - 1];
giveaway.GiftTargetId = "1";
Debug.Log("赠送成功");
ercitanchuang.GetComponent<input_box_pop_up_window>().destroy(); ercitanchuang.GetComponent<input_box_pop_up_window>().destroy();
} }
else else
@ -195,7 +211,7 @@ public class jinsha : mount
if (boxType.customData is BoxData<Item> intData)//通过储存的泛型来查找对应的item数据 if (boxType.customData is BoxData<Item> intData)//通过储存的泛型来查找对应的item数据
{ {
Item item = intData.GetTypedData(); Item item = intData.GetTypedData();
Thingid = item.Id.ToString(); Thingid = item.Id;
go.Show_buy(boxType.icon, boxType.prompt, 64, boxType.Num, itemDataList[boxType.Num].Gold, false); go.Show_buy(boxType.icon, boxType.prompt, 64, boxType.Num, itemDataList[boxType.Num].Gold, false);
} }
} }
@ -259,6 +275,9 @@ public class jinsha : mount
{ {
if (type == 1) if (type == 1)
{ {
//赠送逻辑 //赠送逻辑
ercitanchuang.GetComponent<input_box_pop_up_window>().destroy(); ercitanchuang.GetComponent<input_box_pop_up_window>().destroy();
} }