Esempio n. 1
0
 //End turn
 public void EndOfTheTurn()
 {
     ball.isFirst = false;
     isHit        = false;
     scoringSystem.CheckScore();
     CancelInvoke("CountDownTimer");
     timeLeft = 30;
     ShowChangeTurnPanel();
 }
 // Update is called once per frame
 void FixedUpdate()
 {
     if (isDead == false)
     {
         if (powerAmount >= powerMaxAmount)
         {
             abilityTouchButton.SetActive(true);
         }
         score += m_increment;
         counter++;
         if ((counter > powerDrainCount) && (powerAmount > 0) && (powerDrain == true) && (powerAmount < powerMaxAmount))
         {
             powerAmount += -powerDrainAmount;
             counter      = 0;
         }
         powerBar.value = powerAmount;
         if (Input.GetKey("space"))
         {
             if ((powerAmount >= powerMaxAmount) && (powered != true))
             {
                 powerAmount = 0;
                 lizardGlow.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
                 powered = true;
                 powerUp.SetActive(true);
                 abilityTouchButton.SetActive(false);
             }
         }
         if ((invincible == true) && (invincibleCounter < invincibleTimeLimit))
         {
             invincibleCounter++;
         }
         if (invincibleCounter >= invincibleTimeLimit)
         {
             invincible        = false;
             invincibleCounter = 0;
         }
     }
     if (isDead == true)
     {
         firefly.SetActive(false);
         lizardGlow.SetActive(false);
         spawnNet.SetActive(false);
         if (m_scoringSystem)
         {
             m_scoringSystem.CheckScore(score);
         }
         else
         {
             deathScreenUI.SetActive(true);
         }
         playerModel.SetActive(false);
         deathParticles.SetActive(true);
         //SceneManager.LoadScene(0);
     }
     scoreBoard.text = ("" + score + "m");
 }