Exemple #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Star"))
     {
         soundManager.PlayReward();
         scoreManager.AddScoreBy(1);
         Destroy(other.gameObject);
         backgroundColor.MixRandomColor();
         cam.SetBackgroundColor(backgroundColor.GetCurrentColor());
     }
     else if (other.gameObject.CompareTag("Obstacle"))
     {
         //GAME OVER HERE
         gameManager.Restart();
         //Debug.Log("Game Over");
     }
 }