Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
 public void ResetTimer()
 {
     timer.Reset();
 }