This commit is contained in:
shurongsen 2024-11-03 04:47:11 +08:00
parent 4fd5b121c1
commit 2584c6b0b5
5 changed files with 90 additions and 36 deletions

View File

@ -2133,11 +2133,13 @@ MonoBehaviour:
maxNumer: 10
haveNumber: 0
type: 0
buy_type: 6
haveNumber_text: {fileID: 842003837}
toolsNumber_text: {fileID: 0}
minerPrefab: {fileID: 2856136438398072313, guid: 67184d017c6661d4e84c0466d6e6bfb7, type: 3}
gold: {fileID: 1222826993}
startPos: {fileID: 1029900289}
itemlist: []
cazhi:
- {fileID: 0}
- {fileID: 0}
@ -2363,11 +2365,13 @@ MonoBehaviour:
maxNumer: 10
haveNumber: 0
type: 4
buy_type: 8
haveNumber_text: {fileID: 221409765}
toolsNumber_text: {fileID: 0}
minerPrefab: {fileID: 3444381990910610855, guid: d18dec04f037a5647a17ca845b55e1bb, type: 3}
gold: {fileID: 85787133}
startPos: {fileID: 550528965}
itemlist: []
cazhi:
- {fileID: 0}
- {fileID: 0}
@ -2509,11 +2513,13 @@ MonoBehaviour:
maxNumer: 10
haveNumber: 0
type: 2
buy_type: 7
haveNumber_text: {fileID: 364651119}
toolsNumber_text: {fileID: 0}
minerPrefab: {fileID: 9167270724560323185, guid: 51cabd50fc321d547b885e691319bc11, type: 3}
gold: {fileID: 1738523665}
startPos: {fileID: 1193921915}
itemlist: []
cazhi:
- {fileID: 0}
- {fileID: 0}
@ -4462,11 +4468,13 @@ MonoBehaviour:
maxNumer: 10
haveNumber: 0
type: 8
buy_type: 10
haveNumber_text: {fileID: 925527157}
toolsNumber_text: {fileID: 0}
minerPrefab: {fileID: 990481224290882605, guid: c6ab1b51d61a9fc46b497728bd3adf5b, type: 3}
gold: {fileID: 387735378}
startPos: {fileID: 1067071692}
itemlist: []
cazhi:
- {fileID: 0}
- {fileID: 0}
@ -7463,11 +7471,13 @@ MonoBehaviour:
maxNumer: 10
haveNumber: 0
type: 6
buy_type: 9
haveNumber_text: {fileID: 1537079302}
toolsNumber_text: {fileID: 0}
minerPrefab: {fileID: 4568907524513556043, guid: 9b53a49e2b9d7564db62f0993ac45b61, type: 3}
gold: {fileID: 1107876061}
startPos: {fileID: 603196366}
itemlist: []
cazhi:
- {fileID: 0}
- {fileID: 0}

View File

@ -58,7 +58,21 @@ public class VoucherItem:Res//
public string CreateDateTime;
}
public class AllVocherItem
public class Use_daijinjuan
{
public string Id;
}
public class Mining_Wizard_ID //挖矿精灵id
{
public string[] Ids;
}
public class AllVocherItem //所有代金卷数据
{
public string Id;
public string GeneratorId;

View File

@ -16,9 +16,9 @@ public class Get_a_voucher : mount
public async void iii()
{
Login login = new Login();
login.Phone = "123";
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
//Login login = new Login();
// login.Phone = "123";
// await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
}

View File

@ -103,7 +103,7 @@ public class JinShaBuy : mount
generateForFisherElf.Count =Convert.ToInt32( boxTypes[1].content);
//Debug.Log(generateForFisherElf);
string response = await web.SendRequest(web.URL+ "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf));
Debug.Log(response);
Debug.Log("用户产生代金卷"+response);
// Debug.Log(boxTypes[1].content);
//number = int.Parse(boxTypes[0].content);

View File

@ -13,21 +13,31 @@ public class room : mount
public int maxNumer=10;
public int haveNumber = 0;
public int type = 0;
public int buy_type;
private int toolsNumber = 0;
public TextMeshPro haveNumber_text;
public TextMeshPro toolsNumber_text;
public GameObject minerPrefab;
public Transform gold;
public Transform startPos;
public Transform startPos;
public List<Item> itemlist = new List<Item>();
public List<GameObject> cazhi;
public GameObject BlackRoom;
public GameObject Boom;
// Start is called before the first frame update
public override void Awake()
{
}
void Start()
{
if (toolsNumber_text==null)
@ -35,8 +45,11 @@ public class room : mount
toolsNumber = 10;
haveNumber = 10;
}
ChangeTextPro();
loding();
// Allminer();
}
private void OnEnable()
@ -79,8 +92,6 @@ public class room : mount
UpdateShowCazhi();
ChangeTextPro();
Generate();//是否有宝石
//Vector3
GameObject.Instantiate(Boom, new Vector3(startPos.position.x, startPos.position.y + 0.5f, startPos.position.z - 1f), Quaternion.identity);
@ -120,8 +131,10 @@ public class room : mount
UpdateShowCazhi();
ChangeTextPro();
Generate();//是否有宝石
Generate(1);//创建对应id的矿工精灵
//Vector3
GameObject.Instantiate(Boom,new Vector3(startPos.position.x, startPos.position.y+0.5f, startPos.position.z-1f),Quaternion.identity);
await Task.Delay(500);
GameObject newMiner = GameObject.Instantiate(minerPrefab);
@ -216,18 +229,55 @@ public class room : mount
}
}
private async void Generate()
private async void loding()
{
string response = await web.SendRequest("http://47.109.133.52/FisherElfActive/GetListOfGem", "POST");
Login login = new Login();
login.Phone = "1";
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
}
private async void Generate(int count)
{
GenerateForFisherElf generateForFisherElf = new GenerateForFisherElf(); // 购买矿工
generateForFisherElf.Num = buy_type;
generateForFisherElf.Count = count;
string response = await web.SendRequest(web.URL + "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf));
Debug.Log(response);
GetListOfGem data= JsonUtility.FromJson<GetListOfGem>(response);
if (data.ErrorMessage == "")
Mining_Wizard_ID data = JsonUtility.FromJson<Mining_Wizard_ID>(response);
Use use = new Use();
use.Id = data.Ids[0];
string jsonString = JsonUtility.ToJson(use.Id);
string aa =await web.SendRequest(web.URL + "/Voucher/Use", "POST", jsonString);
Debug.Log(aa);
}
private async void Allminer()
{
string response = await web.SendRequest(web.URL+"/MinerElf/GetList", "POST");
Debug.Log(response);
Response reslist = JsonUtility.FromJson<Response>(response);
for (int i=0;i<reslist.List.Length;i++)
{
Debug.Log("连接成功");
if (reslist.List[i].Type == 1)
{
itemlist.Add(reslist.List[i]);
}
}
}
//¿ªÍØ·¿¼ä
void GetRoom()
{
@ -293,25 +343,5 @@ public class room : mount
}
public class GetListOfGem
{
public List<Item> List;
public int ErrorCode;
public string ErrorMessage;
}
public class GetListOfGemItem
{
public string Id;
public int Num;
public int Type;
public string OwnerId;
public int ActivateValue;
public int GenerateValue;
public int AlreadyGenerateValue;
public int RemainEndureTime;
public int EndureTime;
public string CreateDateTime;
}