Compare commits
3 Commits
43a749329e
...
441ff1d21d
Author | SHA1 | Date | |
---|---|---|---|
441ff1d21d | |||
0059644b31 | |||
105c1b3237 |
@ -13,17 +13,17 @@ public struct Register
|
||||
{
|
||||
public string Phone;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct AddGold
|
||||
{
|
||||
public int Gold;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct Login
|
||||
{
|
||||
public string Phone;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct GetListByPhone
|
||||
{
|
||||
public string Phone;
|
||||
@ -44,6 +44,7 @@ public class Item//
|
||||
public List<float> ReferrerBouns;
|
||||
public string CreateDateTime;
|
||||
}
|
||||
[Serializable]
|
||||
public class VoucherItem:Res//返回的代金卷数据
|
||||
{
|
||||
public string Id;
|
||||
@ -59,19 +60,19 @@ public class VoucherItem:Res//
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class Use_daijinjuan
|
||||
{
|
||||
public string Id;
|
||||
}
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class Mining_Wizard_ID //挖矿精灵id
|
||||
{
|
||||
public string[] Ids;
|
||||
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Giveaway //赠送代金卷
|
||||
{
|
||||
public string[] Ids;
|
||||
@ -80,20 +81,25 @@ public class Giveaway //
|
||||
|
||||
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class AllVocherItem //所有代金卷数据
|
||||
{
|
||||
public string Id;
|
||||
public string GeneratorId;
|
||||
public string OwnerId;
|
||||
public int Type;
|
||||
public int Num;
|
||||
public float Type;
|
||||
public float Num;
|
||||
public bool IsUsed;
|
||||
public bool IsAdmin;
|
||||
public string UsedDateTime;
|
||||
public string CreateDateTime;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Res//ÏûÏ¢·µ»ØÀà
|
||||
{
|
||||
public int ErrorCode;
|
||||
public string ErrorMessage;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AllVocherItemRes : Res
|
||||
@ -130,11 +136,7 @@ public class ids:Res
|
||||
public List<string> Ids;
|
||||
|
||||
}
|
||||
public class Res//ÏûÏ¢·µ»ØÀà
|
||||
{
|
||||
public int ErrorCode;
|
||||
public string ErrorMessage;
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class ItemData//道具类 所有的道具都是这个结构体
|
||||
|
@ -6,12 +6,19 @@ public class Get_a_voucher : mount
|
||||
{
|
||||
|
||||
List<AllVocherItem> Wakuanglist = new List<AllVocherItem>();
|
||||
int[] Floorint = new int[] {0,0,0,0,0};
|
||||
// Start is called before the first frame update
|
||||
public override void Awake()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
|
||||
InvokeRepeating("ExecuteTask", 1.0f, 1.0f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async void iii()
|
||||
@ -24,14 +31,17 @@ public class Get_a_voucher : mount
|
||||
|
||||
async void ExecuteTask()
|
||||
{
|
||||
string userponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
|
||||
// Debug.Log(userponse);
|
||||
AllVocherItemRes itemList = JsonUtility.FromJson<AllVocherItemRes>(userponse);
|
||||
// Debug.Log(itemList.List.Length);
|
||||
|
||||
|
||||
string daijinjuanponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
|
||||
Debug.Log("用户所有代金卷" + daijinjuanponse);
|
||||
AllVocherItemRes itemList = JsonUtility.FromJson<AllVocherItemRes>(daijinjuanponse);
|
||||
Debug.Log(itemList.List.Length);
|
||||
|
||||
Debug.Log(itemList.List.Length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ public class Logo_in : mount
|
||||
login.Phone = boxTypes[0].content;
|
||||
//register.Code = boxTypes[0].content;
|
||||
string jsonString = JsonUtility.ToJson(login);
|
||||
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST", jsonString);
|
||||
string response = await web.SendRequest(web.URL+"/Player/Register", "POST", jsonString);
|
||||
Debug.Log(response);
|
||||
}
|
||||
else if (type == 1)//怬
|
||||
@ -77,13 +77,10 @@ public class Logo_in : mount
|
||||
Debug.Log(boxTypes[0].content);
|
||||
//register.Code = boxTypes[0].content;
|
||||
string jsonString = JsonUtility.ToJson(login);
|
||||
string response = await web.SendRequest("http://47.109.133.52/Player/Login", "POST", jsonString);
|
||||
string response = await web.SendRequest(web.URL+"/Player/Login", "POST", jsonString);
|
||||
Debug.Log(response);
|
||||
|
||||
|
||||
string daijinjuanponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
|
||||
Debug.Log("用户所有代金卷" + daijinjuanponse);
|
||||
|
||||
Rootobject root = JsonUtility.FromJson<Rootobject>(response);
|
||||
|
||||
|
||||
|
@ -32,14 +32,12 @@ public class jinsha : mount
|
||||
}
|
||||
public int type = 0;
|
||||
|
||||
public async void loding()
|
||||
|
||||
public async void Start()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async void buy_miners()//¹ºÂò½ð±Ò¿ó¹¤½çÃæ
|
||||
{
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class room : mount
|
||||
|
||||
ChangeTextPro();
|
||||
|
||||
loding();
|
||||
loding();
|
||||
// Allminer();
|
||||
}
|
||||
|
||||
@ -113,22 +113,22 @@ public class room : mount
|
||||
return;
|
||||
}
|
||||
|
||||
if (toolsNumber_text == null)
|
||||
{
|
||||
GetRoom();
|
||||
//if (toolsNumber_text == null)
|
||||
//{
|
||||
|
||||
Debug.Log("扣钱检测");
|
||||
if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11)
|
||||
{
|
||||
Promptmgr.Instance.PromptBubble("购买卷不足", Color.black, Color.red);
|
||||
return;
|
||||
}
|
||||
PlayerManager.Instance.SetMoney(MoneyType.Stones, -10);
|
||||
}
|
||||
|
||||
// Debug.Log("¿ÛÇ®¼ì²â");
|
||||
// if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11)
|
||||
// {
|
||||
// Promptmgr.Instance.PromptBubble("¹ºÂò¾í²»×ã", Color.black, Color.red);
|
||||
// return;
|
||||
// }
|
||||
// PlayerManager.Instance.SetMoney(MoneyType.Stones, -10);
|
||||
//}
|
||||
Generate(1);
|
||||
if (!Buy_succefful) return;
|
||||
Generate(1);
|
||||
|
||||
GetRoom();
|
||||
haveNumber--;
|
||||
toolsNumber--;
|
||||
UpdateShowCazhi();
|
||||
@ -144,7 +144,7 @@ public class room : mount
|
||||
newMiner.transform.SetParent(startPos);
|
||||
newMiner.transform.position = startPos.position;
|
||||
|
||||
|
||||
Buy_succefful = false;
|
||||
|
||||
}
|
||||
|
||||
@ -247,12 +247,10 @@ public class room : mount
|
||||
generateForFisherElf.Count = count;
|
||||
string response = await web.SendRequest(web.URL + "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf));
|
||||
|
||||
|
||||
|
||||
Mining_Wizard_ID data = JsonUtility.FromJson<Mining_Wizard_ID>(response);
|
||||
Use use = new Use();
|
||||
use.Id = data.Ids[0];
|
||||
if (data.Ids[0] != null)
|
||||
if (use.Id != null)
|
||||
{
|
||||
Buy_succefful = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user