Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (!gameOver)
     {
         score         += Time.deltaTime * 2;
         scoreText.text = "" + (int)(score);
         foreach (GameObject obj in sprites)
         {
             obj.transform.position += Vector3.left * Time.deltaTime * Speed;
             if (obj.transform.position.x < -17.6f)
             {
                 obj.transform.position = new Vector2(17f * 2, 1.1f);
             }
         }
     }
     else
     {
         gameovertimer -= Time.deltaTime;
         if (gameovertimer < 0)
         {
             gmeOvrCanvas.SetActive(true);
             PauseCanvas.SetActive(false);
             Canvas.SetActive(false);
         }
     }
     //else { Time.timeScale =0; }
 }
 public void ButContinue()
 {
     Time.timeScale = 1;
     PauseCanvas.SetActive(false);
     MainCanvass.SetActive(true);
 }
 public void ButPause()
 {
     Time.timeScale = 0;
     PauseCanvas.SetActive(true);
     MainCanvass.SetActive(false);
 }