Пример #1
0
 void FixedUpdate()
 {
     //Debug.Log("UPDATING");
     if (startTimer)
     {
         remainingTime -= Time.deltaTime;
         timer.text     = (remainingTime).ToString("0.0");
     }
     if (remainingTime <= 0 && win == false)
     {
         startTimer = false;
         //Time.timeScale = 0;
         playerLostScreen.SetActive(true);
     }
     else if (win == true && winOver == false)
     {
         startTimer = false;
         //Time.timeScale = 0;
         changeResource = resourceManager.resources.Find(name => name.name == resourceName);
         changeResource.Add(resourceAmount);
         playerWonScreen.SetActive(true);
         winOver = true;
     }
 }