private void CreateButtons() { var randomPets = GenerateRandomPets(); foreach (GameObject pet in randomPets) { GameObject buttonGameObject = Instantiate(petButton, transform); PetSelectionButton button = buttonGameObject.GetComponent <PetSelectionButton>(); button.InitializeButton(pet); } }
private void CreateButtons() { List <string> unlockedPets = saveManager.activeSave.unlockedPets; foreach (string petName in unlockedPets) { GameObject pet = PetData.GetPetData(petName); GameObject buttonGameObject = Instantiate(petButton, transform); PetSelectionButton button = buttonGameObject.GetComponent <PetSelectionButton>(); button.InitializeButton(pet); } }