Example #1
0
 public void OnBuyButtonClicked()
 {
     Debug.Log("I bought seed " + SeedRef.DisplayName + " for " + SeedRef.Cost);
     GardenManagerRef.UpdateMoney(-(SeedRef.Cost));
     GardenManagerRef.AddSeed(SeedRef.SeedId, 1);
     foreach (KeyValuePair <int, int> entry in GardenManagerRef.GetSeeds())
     {
         Debug.Log("I have the following Rarity " + entry.Key.ToString() + " seeds: " + entry.Value.ToString());
     }
 }
Example #2
0
        public void InitFeederModal(Feeder feeder, GardenManager gardenManager)
        {
            FeederRef        = feeder;
            GardenManagerRef = gardenManager;

            Dictionary <int, int> seedInventory = GardenManagerRef.GetSeeds();

            foreach (int seedId in seedInventory.Keys)
            {
                Seed       seedtype = GardenManagerRef.GetSeedTypeById(seedId);
                FeederItem item     = Instantiate <FeederItem>(FeederItemPrefab, ContentRoot.transform);
                item.InitFeederItem(seedtype, seedInventory[seedId], this);
            }
        }