using System.Collections; using System.Collections.Generic; using UnityEngine; using DataTools; public class GigsPanel : MonoBehaviour { [SerializeField] private DataUser data; [SerializeField] private GigUIData gigUIElement; [SerializeField] private Transform content; private void CleanContent() { foreach (Transform child in content.transform) { GameObject.Destroy(child.gameObject); } } private void SetupContent() { foreach (DataTools.Gig gig in data.UserData.ProgressData.GigsPlayed) { GigUIData GgigUINewElement = Instantiate(gigUIElement, content); GgigUINewElement.SetupGigUI(gig); } } private void OnEnable() { CleanContent(); SetupContent(); } }