_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/lianghaoLL/AnniyncementPanel.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2024-11-27 21:48:36 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2024-11-27 23:34:21 +08:00
using UnityEngine.UI;
public class AnniyncementPanel : Base
2024-11-27 21:48:36 +08:00
{
2024-11-27 23:34:21 +08:00
public GameObject Content;
announcementPage31 page31 = new announcementPage31();
announcementPage announcementPage = new announcementPage();
2024-11-27 21:48:36 +08:00
// Start is called before the first frame update
void Start()
{
2024-11-27 23:34:21 +08:00
testLogo();
2024-11-27 21:48:36 +08:00
Init();
2024-11-27 23:34:21 +08:00
2024-11-27 21:48:36 +08:00
}
async void Init()
{
2024-11-27 23:34:21 +08:00
announcementPage = await page31.announcementPage(1,20);
Debug.Log(announcementPage.data.totalCount);
for (int i = 0; i < announcementPage.data.totalCount; i++)
{
GameObject Page = (GameObject)Instantiate(Resources.Load("LLPrefabs/Announcement_newitem"), Content.transform);
Page.GetComponent<Announcementitem>().neirong.text = announcementPage.data.dataList[i].title;
Page.GetComponent<Announcementitem>().creatTime.text = announcementPage.data.dataList[i].createTime;
}
2024-11-27 21:48:36 +08:00
}
// Update is called once per frame
void Update()
{
}
}