Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (player.Dead && !playerDied)
     {
         playerDied = true;
         obstacleGenerator.AddText(GameOverText);
         score = 0;
     }
     else
     {
         if (!player.Dead && playerDied)
         {
             playerDied = false;
         }
     }
     if (player.Grinding && !playerStartedGrind)
     {
         playerStartedGrind      = true;
         currentScoreMultiplier += GrindScoreMultiplier;
         //obstacleGenerator.AddText(SlappyText);
     }
     else
     {
         if (!player.Grinding && playerStartedGrind)
         {
             playerStartedGrind      = false;
             currentScoreMultiplier -= GrindScoreMultiplier;
         }
     }
     score         += (long)(currentScoreMultiplier * player.Speed);
     ScoreText.text = score.ToString("D8");
 }