_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Trade/TradeDes.cs

83 lines
1.7 KiB
C#
Raw Normal View History

using System;
2024-11-25 23:54:53 +08:00
using System.Collections;
using System.Collections.Generic;
using TMPro;
2024-11-25 23:54:53 +08:00
using UnityEngine;
using UnityEngine.UI;
2024-11-25 23:54:53 +08:00
//public class Union
//{
// public int id;
// public string name;
// public string iconName;
// public string counts;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//}
public class TradeDes : MonoBehaviour
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public int id;
public string name;
public string cover;
public string counts;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public int level;
public string slogan;
public int leaderId;
public string leaderUserName;
public string createTime;
public string updateTime;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Button sqBtn;//<2F><><EFBFBD>밴ť
public Button panelBtn;//<2F><><EFBFBD>밴ť
public TextMeshProUGUI nameTxt;//<2F><><EFBFBD><EFBFBD>text
//public TextMeshPro countTxt;//<2F><><EFBFBD><EFBFBD>Text
2024-11-25 23:54:53 +08:00
public GameObject detailPrefab;
public Transform canvasTrans;
2024-11-25 23:54:53 +08:00
// Start is called before the first frame update
void Awake()
2024-11-25 23:54:53 +08:00
{
if (sqBtn == null)
Debug.LogError("<22><><EFBFBD>밴ťδ<C5A5>ҵ<EFBFBD><D2B5><EFBFBD>");
if (nameTxt == null)
Debug.LogError("<22><><EFBFBD><EFBFBD> TextMeshPro <20><><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>");
sqBtn.onClick.AddListener(ShowDetail);
panelBtn.onClick.AddListener(ShowDetail);
2024-11-25 23:54:53 +08:00
}
2024-11-25 23:54:53 +08:00
// Update is called once per frame
void Update()
{
}
public void ShowDetail()
{
GameObject.Instantiate(detailPrefab, canvasTrans);
}
2024-11-25 23:54:53 +08:00
public void SetInfo(UnionDataInPage body)
{
id = body.Id;
name = body.Name;
cover = body.Cover;
level = body.Level;
slogan = body.Slogan;
leaderId = body.LeaderId;
leaderUserName = body.LeaderUserName;
createTime = body.CreateTime;
updateTime = body.UpdateTime;
nameTxt.text = name;
2024-11-25 23:54:53 +08:00
}
}