public void AddFruit(Plant.Type seedType) { CollectableFruit temp = ScriptableObject.CreateInstance("CollectableFruit") as CollectableFruit; temp = Resources.Load <CollectableFruit>(CollectableFruit.FruitDictionary[seedType]); InventoryManager.instance.addItem(temp); }
IEnumerator hide() { yield return(new WaitForSeconds(1)); int max = LevelController.current.getMaxFruits(); for (int i = 1; i <= max; i++) { if (gathered.Contains(i)) { fruits [i - 1].color = new Color(1f, 1f, 1f, 0.5f); CollectableFruit fruit = fruits[i - 1].GetComponentInParent <CollectableFruit>(); fruit.hidden = true; } } }