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

40 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AnniyncementPanel : Base
{
public GameObject Content;
announcementPage31 page31 = new announcementPage31();
announcementPage announcementPage = new announcementPage();
// Start is called before the first frame update
void Start()
{
//testLogo();
Init();
}
async void Init()
{
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>().announcement = announcementPage.data.dataList[i];
Page.GetComponent<Announcementitem>().neirong.text = announcementPage.data.dataList[i].title;
Page.GetComponent<Announcementitem>().creatTime.text = announcementPage.data.dataList[i].createTime;
}
}
// Update is called once per frame
void Update()
{
}
}