2024-11-25 20:56:27 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class TradeUnion : MonoBehaviour
|
|
|
|
{
|
|
|
|
public GameObject gonghuiPrefab;
|
|
|
|
public Transform content;
|
2024-11-25 22:11:11 +08:00
|
|
|
public int count;
|
|
|
|
public List<UnionDataInPage> dataList = new List<UnionDataInPage>();
|
2024-11-25 21:10:11 +08:00
|
|
|
|
2024-11-26 15:50:37 +08:00
|
|
|
|
2024-11-25 20:56:27 +08:00
|
|
|
// Start is called before the first frame update
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
ReadData();
|
|
|
|
|
2024-11-26 16:26:07 +08:00
|
|
|
//testLogo();
|
2024-11-25 20:56:27 +08:00
|
|
|
}
|
|
|
|
|
2024-11-25 22:11:11 +08:00
|
|
|
public async void ReadData()
|
2024-11-25 20:56:27 +08:00
|
|
|
{
|
2024-11-25 22:11:11 +08:00
|
|
|
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;
|
2024-11-26 15:50:37 +08:00
|
|
|
TradeDes tradeDes = union.GetComponent<TradeDes>();
|
2024-11-26 16:26:07 +08:00
|
|
|
tradeDes.SetInfo(unionPage.Data.DataList[i],transform);
|
2024-11-25 22:11:11 +08:00
|
|
|
}
|
2024-11-25 20:56:27 +08:00
|
|
|
|
|
|
|
}
|
2024-11-26 16:26:07 +08:00
|
|
|
|
2024-11-25 20:56:27 +08:00
|
|
|
|
2024-11-25 22:11:11 +08:00
|
|
|
|
2024-11-25 20:56:27 +08:00
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
2024-11-26 16:26:07 +08:00
|
|
|
//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());
|
2024-11-25 20:56:27 +08:00
|
|
|
}
|
|
|
|
}
|