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

68 lines
1.5 KiB
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
//public class Union
//{
// public int id;
// public string name;
// public string iconName;
// public string counts;//公会人数
//}
public class TradeDes : MonoBehaviour
{
//公会属性
public int id;
public string name;
public string cover;
public string counts;//公会人数
public int level;
public string slogan;
public int leaderId;
public string leaderUserName;
public string createTime;
public string updateTime;
//公会相关组件
public Button sqBtn;//申请按钮
public TextMeshProUGUI nameTxt;//名称text
//public TextMeshPro countTxt;//数量Text
// Start is called before the first frame update
void Awake()
{
sqBtn = transform.Find("Button").GetComponent<Button>();
nameTxt = transform.Find("name").GetComponent<TextMeshProUGUI>();
if (sqBtn == null)
Debug.LogError("申请按钮未找到!");
if (nameTxt == null)
Debug.LogError("名称 TextMeshPro 组件未找到!");
}
// Update is called once per frame
void Update()
{
}
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;
}
}