_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Trade/TradeUnion.cs
2024-11-26 16:26:07 +08:00

49 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TradeUnion : MonoBehaviour
{
public GameObject gonghuiPrefab;
public Transform content;
public int count;
public List<UnionDataInPage> dataList = new List<UnionDataInPage>();
// Start is called before the first frame update
void Start()
{
ReadData();
//testLogo();
}
public async void ReadData()
{
UnionPage unionPage = new UnionPage();
UnionPage16 unionPage16 = new UnionPage16();
unionPage = await unionPage16.queryUnionPage(1);
Debug.Log(unionPage.Data.TotalCount);
count = unionPage.Data.TotalCount;
dataList = unionPage.Data.DataList;
for(int i = 0; i < dataList.Count; i++)
{
GameObject union = GameObject.Instantiate(gonghuiPrefab, content);
union.name = "union_" + i;
TradeDes tradeDes = union.GetComponent<TradeDes>();
tradeDes.SetInfo(unionPage.Data.DataList[i],transform);
}
}
// Update is called once per frame
void Update()
{
//testhead
//string response511 = await web.SendRequest(web.URL + "/snail/gameEscape/queryLatest", "POST", body, testhead);
//string response511 = await web.SendRequest(web.URL + "/snail/gameEscape/queryLatest", "POST", body, Global.global.CreateHeaders());
}
}