Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "LoseBox")
        {
            //Check if player has lost
            if (Player_script_ref.MinusLife() == 0)
            {
                Lose_Panel.SetActive(true);
                if (score > best_score)
                {
                    best_score = score;
                    PlayerPrefs.SetInt("BestScore", score);
                }
                Lose_Panel.GetComponentInChildren <Text>().text = "Best Score: " + best_score;
            }

            else
            {
                BallRespawn();
            }
        }
    }