Exemplo n.º 1
0
 void OnCollisionEnter2D(Collision2D c)
 {
     if (c.gameObject.tag == "Enemy Car")
     {
         SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
         Destroy(gameObject);
         obj.GameOver();
     }
 }
Exemplo n.º 2
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Enemy Car")
     {
         Destroy(gameObject);
         ui.GameOver();
         am.carSound.Stop();
     }
 }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     timeLeft          -= Time.deltaTime;
     countDownText.text = "Time Left: " + Mathf.Round(timeLeft);
     if (timeLeft < 0)
     {
         timeLeft = 0;
         dieCommand.GameOver();
         //Load a UiManager
         //SceneManager.LoadScene("one");
         //StartCoroutine ("Wait");
     }
 }