using System.Collections; using System.Collections.Generic; using UnityEngine; public class EventPanel : MonoBehaviour { public GameObject ErrorInfoItem; public Transform Content; public ButtonRecordByAC CloseButton; private void Start() { CloseButton.OutInterFaceButton = Close; } // Start is called before the first frame update private void OnEnable() { LoadItem(); } private void Close() { gameObject.SetActive(false); } private void LoadItem() { CleartItem(); List errorList = REPORT_ERROR_SYNC.ErrorList; for (int i = 0; i < errorList.Count; i++) { GameObject item = Instantiate(ErrorInfoItem,Content); item.GetComponent().SetValue(errorList[i]); } } private void CleartItem() { for (int i = 0; i < Content.childCount; i++) { Destroy(Content.GetChild(i).gameObject); } } // Update is called once per frame void Update() { } }