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

54 lines
1.5 KiB
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;
using static UnityEditor.Progress;
2024-11-29 20:05:19 +08:00
public class PersonnelPanel : MonoBehaviour
{
public Text personelPanelText;
public Text personelNumText;
2024-12-20 17:57:13 +08:00
public Text lockText;
2024-11-30 10:19:52 +08:00
public Transform personelContent;
public GameObject personelItem;
public GameObject firstLablePrefab;
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 16:19:19 +08:00
public void CreatePeopleItem(List<SelectedInfo> peopleList)
2024-11-29 20:05:19 +08:00
{
2024-11-30 16:19:19 +08:00
foreach (Transform child in personelContent)
{
Destroy(child.gameObject);
}
foreach (var personel in peopleList)
{
CreatePersonelItem(personel, personelContent);
}
}
public void CreatePersonelItem(SelectedInfo person, Transform parentTransform)
{
2024-11-30 10:19:52 +08:00
// ʵ<><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>
2024-11-30 16:19:19 +08:00
GameObject item = Instantiate(personelItem, parentTransform);
2024-11-30 10:19:52 +08:00
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
}
2024-12-19 14:11:11 +08:00
public void CreateSceneItem(SelectedInfo person, Transform parentTransform)
{
GameObject item = Instantiate(personelItem, parentTransform);
PersonnelInfo personnelItem = item.GetComponent<PersonnelInfo>();
}
2024-11-30 23:32:17 +08:00
public void OnClickBtn()
{
transform.gameObject.SetActive(false);
}
2024-11-29 20:05:19 +08:00
}