void Update() { foreach (Transform child in PollenDisplayList.transform) { PollenDisplay display = child.GetComponent <PollenDisplay>(); if (display) { if (display.flowerType != null) { float pollen = PlayerInventory.Instance.GetPollen(display.flowerType.Id); if (pollen > 0) { display.Show(); display.DisplayPollen((int)pollen); } else { display.Hide(); } } else { display.Hide(); } } } }
void DisplayPollenCosts(ShopItemCost[] costs) { foreach (Transform child in PollenDisplayList.transform) { PollenDisplay display = child.GetComponent <PollenDisplay>(); if (display) { if (display.flowerType != null) { display.Hide(); foreach (ShopItemCost cost in costs) { if (display.flowerType == cost.Flower) { display.Show(); display.DisplayPollen(cost.Pollen); } } } else { display.Hide(); } } } }
void ClearPollenCosts() { foreach (Transform child in PollenDisplayList.transform) { PollenDisplay display = child.GetComponent <PollenDisplay>(); if (display) { display.Hide(); } } }