Cute_demon_attacks/meng_yao/Assets/script/Panel/CertificatePanel.cs
2025-01-04 19:24:55 +08:00

63 lines
1.8 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CertificatePanel : MonoBehaviour
{
// Start is called before the first frame update
public Text UidText;
public Text NicknameText;
public Text SerialText;
public Text coplesText;
public Text islandnameText;
public Text IssuedaText;
public Button left;
public Button right;
public certificateResponse response;
private int num = 0;
async void Start()
{
//response = await Scene_main_jiekou.instance.AuctionCertificate();
if(response==null)return;
UidText.text = response.Data[0].uid;
NicknameText.text = response.Data[0].nickname;
SerialText.text = response.Data[0].serial_no;
coplesText.text = response.Data[0].copies.ToString();
islandnameText.text = response.Data[0].island_name;
IssuedaText.text = response.Data[0].issue_date;
left.onClick.AddListener(() =>
{
if (response == null) return;
if (num<=0) return;
num--;
detailchange(num);
});
right.onClick.AddListener(() =>
{
if (response == null) return;
if (num < response.Data.Count-1)
{
num++;
detailchange(num);
}
});
}
void detailchange(int count)
{
UidText.text = response.Data[count].uid;
NicknameText.text = response.Data[count].nickname;
SerialText.text = response.Data[count].serial_no;
coplesText.text = response.Data[count].copies.ToString();
islandnameText.text = response.Data[count].island_name;
IssuedaText.text = response.Data[count].issue_date;
}
// Update is called once per frame
void Update()
{
}
}