示例#1
0
 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();
             }
         }
     }
 }
示例#2
0
 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();
             }
         }
     }
 }
示例#3
0
 void ClearPollenCosts()
 {
     foreach (Transform child in PollenDisplayList.transform)
     {
         PollenDisplay display = child.GetComponent <PollenDisplay>();
         if (display)
         {
             display.Hide();
         }
     }
 }