_xiaofang/xiaofang/Assets/Script/UI/PanelUI/PersonnelPanel.cs

34 lines
986 B
C#
Raw Normal View History

2024-11-29 20:05:19 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PersonnelPanel : MonoBehaviour
{
public GameObject personnelItem;
public Text personelPanelText;
public Text personelNumText;
2024-11-30 10:19:52 +08:00
public Transform personelContent;
public Panel panelInfo;
public GameObject personelItem;
2024-11-29 20:05:19 +08:00
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
2024-11-30 10:19:52 +08:00
public void CreatePersonelItem(SelectedInfo person, GameObject parentTransform)
2024-11-29 20:05:19 +08:00
{
2024-11-30 10:19:52 +08:00
Transform contentTransform = parentTransform.transform.Find("Scroll View/Viewport/Content");
// ʵ<><CAB5><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EEB2A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
GameObject item = Instantiate(personelItem, contentTransform);
PersonnelInfo personnelItem = item.GetComponent<PersonnelInfo>();
personnelItem.nameText.text = person.name; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-11-29 20:05:19 +08:00
}
}