void feedDogs(DogFoodData food) { int amountFoodNeeded = calculateDogFoodNeeded(); if (amountFoodNeeded <= k.NONE_VALUE) { return; } DogFoodData foodNeeded = food.Copy(); foodNeeded.SetAmount(-amountFoodNeeded); if (dataController.HasFood(food.FoodType, amountFoodNeeded) && !IsCurrentlyFeeding) { dataController.ChangeCurrencyAmount(foodNeeded); buttonReference.interactable = false; EventController.Event(k.GetPlayEvent(k.ADD_FOOD)); dataController.RefillDogFood(); giveDogsFood(foodNeeded); foodBowlImage.color = food.Color; currentFood = foodNeeded; feedingTimer.Reset(); feedingTimer.Begin(); foodSelector.Hide(); } else { EventController.Event(k.GetPlayEvent(k.EMPTY)); foodSelector.SetDescription(LanguageDatabase.GetInstance.GetTerm(k.BUY_MORE_FOOD)); foodSelector.SetDelegate(loadFoodShop); } }
public void ResetTimer() { timer.Reset(); }