Beispiel #1
0
    public void ChangeFood(int amount)
    {
        food += amount;
        if (amount > 0)
        {
            lastTimeFed = DateTime.Now;
        }
        if (food < 0)
        {
            PetManager.instance.Die();
        }

        if (food > 20)
        {
            petController.Fine();
        }

        if (food < 20)
        {
            petController.Hungry();
        }
        else if (food > 100)
        {
            food = 100;
        }
    }
Beispiel #2
0
 public void RestartGame()
 {
     gameOver.SetActive(false);
     pet.Fine();
     needsController.Initialize(100, 100, 100, 15, 5, 7);
 }