示例#1
0
    private void CreateButtons()
    {
        var randomPets = GenerateRandomPets();

        foreach (GameObject pet in randomPets)
        {
            GameObject         buttonGameObject = Instantiate(petButton, transform);
            PetSelectionButton button           = buttonGameObject.GetComponent <PetSelectionButton>();
            button.InitializeButton(pet);
        }
    }
示例#2
0
    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);
        }
    }