He had us do the DetachChildren call again but future him did not stop and tell us to NOT do that. You can even still see in the hierarchy all of the placeholder UI prefabs still there
This seems to work for me. It is similar to what we did in DialogueUI. However, there we had a reference to the root GO in the script. This just looks for children andā¦ murders them:
private void Start()
{
// Clean up placeholder quests.
foreach (Transform kiddo in GetComponentInChildren<Transform>())
{
Destroy(kiddo.gameObject);
}
foreach (Quest quest in tempQuests)
{
QuestItemUI uiInstance = Instantiate<QuestItemUI>(questPrefab, transform);
uiInstance.Setup(quest);
}
}