42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class EvacuationPanel : MonoBehaviour
|
|
{
|
|
public Transform personnelContent;
|
|
public Panel panel;
|
|
public GameObject personnelPrefabs;
|
|
public GameObject classPrefab;
|
|
public Transform content;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void SetPersonnel()
|
|
{
|
|
foreach (Transform child in personnelContent)
|
|
{
|
|
Destroy(child.gameObject);
|
|
}
|
|
foreach (var sceneEntry in panel.sceneDataDictionary)
|
|
{
|
|
GameObject item = GameObject.Instantiate<GameObject>(personnelPrefabs, personnelContent);
|
|
PersonnelItem personnelItem=item.GetComponent<PersonnelItem>();
|
|
personnelItem.sceneText.text = sceneEntry.Key;
|
|
personnelItem.personnelNum.text = sceneEntry.Value.Count.ToString();
|
|
|
|
}
|
|
|
|
}
|
|
}
|