public void Feeder(GameObject obj) { FoodData foodData = obj.GetComponent <FoodData>(); if (foodData.count <= 0) { return; } obj.GetComponentInChildren <Text>().text = (foodData.count - 1).ToString(); foodData.count--; float addFood = (10 * ((foodData.id * 0.1f) + 1)) * (foodData.id + 1); petAI.Hunger += addFood; int realIdFood = SaveSystem.A_GetRealIdFood(foodData.id); if (foodDic.Keys.Contains(realIdFood)) { foodDic[realIdFood] = foodData.count; } else { foodDic.Add(realIdFood, foodData.count); } StartCoroutine(AnimateSliderOverTime(hunger, addFood * 0.01f, 0.2f)); petAI.PetAct = PetActivity.Happy; if (foodData.count <= 0) { obj.SetActive(false); } }