Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     burger.GetComponent <Animator>().Play(patties[burger.getDoneness()]);
     if (playing)
     {
         if (burger.cookedLevel < 100)
         {
             float val = input.MicLoudness;
             cookingFactor      = val;
             burger.cookedLevel = burger.cookedLevel + val;
         }
         else
         {
             cookingFactor = 0;
         }
         time--;
         clockHand.Rotate(new Vector3(0, 0, -2));
         flames.sizeDelta              = new Vector2(flames.sizeDelta.x, 60.0f * cookingFactor);
         timeBar.sizeDelta             = new Vector2(timeBar.sizeDelta.x - timeSpeed, timeBar.sizeDelta.y);
         arrow.transform.localPosition = new Vector3(burger.cookedLevel - 50, arrow.transform.localPosition.y, 1);
         if (time == 0)
         {
             burgerImages[burgerNum].sprite = burgerSprites[burger.getDoneness()];
             burgerImageObjs[burgerNum].SetActive(true);
             burgerNum++;
             if (burgerNum == 5)
             {
                 burger.makeInactive();
                 playing          = false;
                 score            = burgers[0].getScore() + burgers[1].getScore() + burgers[2].getScore() + burgers[3].getScore() + burgers[4].getScore();
                 gc.currentScore += score;
                 StartCoroutine(goToNextGame());
                 //show score
                 //load next game
             }
             else
             {
                 nextBurger();
             }
         }
     }
 }