Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         f       = new FoodBase();
         ft.text = foodtext[i];
         i++;
         i = i % 5;
     }
     else if (Input.GetKeyDown(KeyCode.Q))
     {
         f = new Salt(f);
     }
     else if (Input.GetKeyDown(KeyCode.W))
     {
         f = new Honey(f);
     }
     ht.text = "hunger gain from food is " + f.GetHunger() + " points.";
     kt.text = "keep time of food is " + f.GetKeepTime() + " days.";
 }
Beispiel #2
0
 public override int GetKeepTime()
 {
     return(seasoned.GetKeepTime());
 }