private void StoreLoadedCompletion() { for (int i = 0; i < spawnedStoreItems.Count; i++) { StoreItemScript spawnedStoreItem = spawnedStoreItems[i]; Destroy(spawnedStoreItem.gameObject); } storeBonusScript.gameObject.SetActive(false); spawnedStoreItems = new List <StoreItemScript>(); for (int i = 0; i < storeSettings.StoreProducts.Length; i++) { if (!ShouldShowItem(storeSettings.StoreProducts[i])) { continue; } StoreProductSettings settings = storeSettings.StoreProducts[i]; if (settings.IsMostPopular) { storeBonusScript.SetUpValues(settings, purchaser); storeBonusScript.gameObject.SetActive(true); continue; } StoreItemScript spawnedStoreItem = Instantiate(storeObject, storeProductsRoot); spawnedStoreItems.Add(spawnedStoreItem); spawnedStoreItem.SetUpValues(storeSettings.StoreProducts[i], purchaser); } StartCoroutine(RemoveLoadingWithDelay()); }
public override void SetButtons(bool enabled) { base.SetButtons(enabled); for (int i = 0; i < spawnedStoreItems.Count; i++) { StoreItemScript itemScript = spawnedStoreItems[i]; itemScript.SetButtonEnabled(enabled); } }