Ejemplo n.º 1
0
    public void populateStore()
    {
        for (int i = 0; i < possibleUpgrades.Length; i++)
        {
            GameObject obj = Instantiate(upgradeItemPrefab, upgradeParent);

            obj.name = possibleUpgrades[i].upgradeName;

            UpgradeContainer uc = obj.GetComponent <UpgradeContainer>();

            uc.configurePrefab(possibleUpgrades[i]);

            uc.getBuyButton().onClick.AddListener(delegate { buyUpgrade(uc.currentUpgrade, uc); });
        }
    }