/////////////Lo que hace al acabarse el tiempo/////////////
    void TiempoAcabado()
    {
        Recordtext.text = ("Tu mejor puntaje: " + PlayerPrefs.GetInt("RecordCR"));
        if (PuntosGeneral > PlayerPrefs.GetInt("RecordCR"))   //si el nuevo puntaje es mayor al record
        {
            PlayerPrefs.SetInt("RecordCR", PuntosGeneral);    //lo sobreescribe
            Recordtext.text = ("Tu mejor puntaje: " + PlayerPrefs.GetInt("RecordCR"));
            print("carga");
        }

        Canvas.SetActive(true);
        BotonPlay.SetActive(false);
        Botonpausa.SetActive(false);
        textoCanvas.text = "¡Se te acabo el tiempo!";
        Orotext.text     = ("Oro:                              " + BonusPU.TotalOro);
        Puntostext.text  = ("Puntuacion:              " + PuntosGeneral.ToString());
    }
    void PersonajePierdeVida()
    {
        //Si personaje pierde todas las vidas y puntaje > a puntaje record, esntones escriba en la red
        if (Dificultad == 4)
        {
            Vidas.text = ("∞");
            // Vidas.fontSize = 50;
        }
        else
        {
            VidasT     = VidasT - 1;
            Vidas.text = ("x" + VidasT).ToString();
            if (VidasT <= 0)
            {
                Canvas.SetActive(true);
                BotonPlay.SetActive(false);
                Botonpausa.SetActive(false);
                textoCanvas.text = "¡Fin del juego!";
                Orotext.text     = ("Oro:                              " + BonusPU.TotalOro);
                Puntostext.text  = ("Puntuacion:               " + PuntosGeneral.ToString());
                EscribirOroTotal();



                if (Dificultad == 3)//Condicion para escribir en el ranking//Modo de juego supervivencia
                {
                    AgregarPuntaje(PlayerPrefs.GetString("PlayerName"), PuntosGeneral);
                    Recordtext.text = ("Tu mejor puntaje: " + PlayerPrefs.GetInt("RecordSurvivor"));
                    if (PuntosGeneral > PlayerPrefs.GetInt("RecordSurvivor")) //si el nuevo puntaje es mayor al record
                    {
                        PlayerPrefs.SetInt("RecordSurvivor", PuntosGeneral);  //lo sobreescribe
                        Recordtext.text = ("Tu mejor puntaje: " + PlayerPrefs.GetInt("RecordSurvivor"));
                        print("carga");
                    }
                }
            }
        }
    }