using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class QuestUI_Parent : MonoBehaviour
{
    private List<QuestUI_Slot> uiSlotList = new List<QuestUI_Slot>();
    public void uiUpdate(List<QuestInfo> questList)
    {

        for (int i = 0; i < questList.Count; i++)
        {
            if (uiSlotList.Count <= i)
            {
                uiSlotList.Add(Instantiate(QuestManager.Instance.uiQuestSlotPrefab, this.transform));
            }
            uiSlotList[i].setQuest(questList[i]);
            uiSlotList[i].gameObject.SetActive(true);
        }
        for (int i = questList.Count; i < uiSlotList.Count; i++)
        {
            uiSlotList[i].setQuest(null);
            uiSlotList[i].gameObject.SetActive(false);
        }
    }
}
