private IEnumerator AddCoinRequest(string token, int cantidad)
    {
        UnityWebRequest addCoinRequest = UnityWebRequest.Post("https://unitrivia.herokuapp.com/api/tienda/insertarMonedas", "");

        addCoinRequest.SetRequestHeader("jwt", token);
        addCoinRequest.SetRequestHeader("cantidad", "" + cantidad);
        yield return(addCoinRequest.SendWebRequest());

        Debug.Log("ResponseCode: " + addCoinRequest.responseCode);

        if (addCoinRequest.result == UnityWebRequest.Result.ConnectionError)
        {
            Debug.Log("ERROR CONNECTION:" + addCoinRequest.result);

            ErrorDataScript.setErrorText("Error de conexión");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else if (addCoinRequest.responseCode != 200)
        {
            Debug.Log("ERROR ADDCOIN:" + addCoinRequest.downloadHandler.text);
            ErrorReturn result = ErrorReturn.CreateFromJSON(addCoinRequest.downloadHandler.text);

            ErrorDataScript.setErrorText(result.message);
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else
        {
            Debug.Log("EXITO ADDCOIN:" + addCoinRequest.downloadHandler.text);
            UserDataScript.addCoins(cantidad);
            Debug.Log("Insertada 1 moneda");
        }
    }
    //Request to the server for Login
    private IEnumerator LoginRequest(string username, string password)
    {
        UnityWebRequest requestLogin = UnityWebRequest.Get("https://unitrivia.herokuapp.com/api/login");

        requestLogin.SetRequestHeader("username", username);
        requestLogin.SetRequestHeader("password", password);
        yield return(requestLogin.SendWebRequest());

        Debug.Log("ResponseCode: " + requestLogin.responseCode);

        if (requestLogin.result == UnityWebRequest.Result.ConnectionError)
        {
            Debug.Log("ERROR CONNECTION:" + requestLogin.result);

            ErrorDataScript.setErrorText("Error de conexión");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else if (requestLogin.responseCode != 200)
        {
            Debug.Log("ERROR LOGIN:"******"Error Scene", LoadSceneMode.Additive);
        }
        else
        {
            Debug.Log("EXITO LOGIN:" + requestLogin.downloadHandler.text);

            //Obtenemos la información del usuario
            StartCoroutine(ProfileRequest(requestLogin.downloadHandler.text));
        }
    }
    private IEnumerator ProfileRequest(string token)
    {
        UnityWebRequest requestProfile = UnityWebRequest.Get("https://unitrivia.herokuapp.com/api/profile");

        requestProfile.SetRequestHeader("jwt", token);
        yield return(requestProfile.SendWebRequest());

        if (requestProfile.result == UnityWebRequest.Result.ConnectionError)
        {
            Debug.Log("ERROR CONNECTION:" + requestProfile.result);

            ErrorDataScript.setErrorText("Error de conexión");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else if (requestProfile.responseCode != 200)
        {
            Debug.Log("ERROR PROFILE:" + requestProfile.downloadHandler.text);
            ErrorReturn result = ErrorReturn.CreateFromJSON(requestProfile.downloadHandler.text);

            ErrorDataScript.setErrorText(result.message);
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else
        {
            Debug.Log("EXITO PROFILE:" + requestProfile.downloadHandler.text);
            ProfileReturn result = ProfileReturn.CreateFromJSON(requestProfile.downloadHandler.text);

            // Save player data
            UserDataScript.setInfo("token", token);
            UserDataScript.setInfo("username", result._id);
            UserDataScript.setInfo("email", result.mail);
            UserDataScript.setInfo("question", result.preg);
            UserDataScript.setInfo("answer", result.res);
            UserDataScript.setInfo("avatar", result.avtr);
            UserDataScript.setInfo("banner", result.bnr);
            UserDataScript.setInfo("ficha", result.fich);
            UserDataScript.setCoins(result.cns);
            UserDataScript.setStats(result.nj, result.ng);
            UserDataScript.setItems(result.rfs);

            SceneManager.LoadScene("Menu Scene", LoadSceneMode.Single);
        }
    }
    //Request to the server for Login
    private IEnumerator BuyRequest(string item)
    {
        UnityWebRequest requestBuy = null;

        requestBuy = UnityWebRequest.Post("https://unitrivia.herokuapp.com/api/tienda/comprar", "");
        requestBuy.SetRequestHeader("nombre", item);
        requestBuy.SetRequestHeader("jwt", UserDataScript.getInfo("token"));
        yield return(requestBuy.SendWebRequest());

        Debug.Log("ResponseCode: " + requestBuy.responseCode);

        if (requestBuy.result == UnityWebRequest.Result.ConnectionError)
        {
            Debug.Log("ERROR CONNECTION ACTIVESHOP:" + requestBuy.result);

            ErrorDataScript.setErrorText("Error de conexión");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else if (requestBuy.responseCode != 200)
        {
            Debug.Log("ERROR ACTIVESHOP:" + requestBuy.downloadHandler.text);
            ErrorReturn result = ErrorReturn.CreateFromJSON(requestBuy.downloadHandler.text);

            ErrorDataScript.setErrorText(result.message);
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
        else
        {
            Debug.Log("EXITO ACTIVESHOP:" + requestBuy.downloadHandler.text);
            SoundManager.PlayBuySound();
            UserDataScript.addItem(item);
            UserDataScript.removeCoins(100);
            checkActualItem();
        }
    }
    //Request to the server for Login
    private IEnumerator ActiveRequest(string item, string type)
    {
        UnityWebRequest requestActive = null;

        switch (type)
        {
        case "avatar":
            requestActive = UnityWebRequest.Post("https://unitrivia.herokuapp.com/api/profile/modify/avatar", "");
            requestActive.SetRequestHeader("idavatar", item);
            break;

        case "banner":
            requestActive = UnityWebRequest.Post("https://unitrivia.herokuapp.com/api/profile/modify/banner", "");
            requestActive.SetRequestHeader("idbanner", item);
            break;

        case "ficha":
            requestActive = UnityWebRequest.Post("https://unitrivia.herokuapp.com/api/profile/modify/formFicha", "");
            requestActive.SetRequestHeader("idformficha", item);
            break;

        default:
            ErrorDataScript.setErrorText("Error inesperado");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
            break;
        }

        if (requestActive != null)
        {
            requestActive.SetRequestHeader("jwt", UserDataScript.getInfo("token"));
            yield return(requestActive.SendWebRequest());

            Debug.Log("ResponseCode: " + requestActive.responseCode);

            if (requestActive.result == UnityWebRequest.Result.ConnectionError)
            {
                Debug.Log("ERROR CONNECTION ACTIVESHOP:" + requestActive.result);

                ErrorDataScript.setErrorText("Error de conexión");
                ErrorDataScript.setButtonMode(1);
                SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
            }
            else if (requestActive.responseCode != 200)
            {
                Debug.Log("ERROR ACTIVESHOP:" + requestActive.downloadHandler.text);
                ErrorReturn result = ErrorReturn.CreateFromJSON(requestActive.downloadHandler.text);

                ErrorDataScript.setErrorText(result.message);
                ErrorDataScript.setButtonMode(1);
                SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
            }
            else
            {
                Debug.Log("EXITO ACTIVESHOP:" + requestActive.downloadHandler.text);

                switch (type)
                {
                case "avatar":
                    UserDataScript.setInfo("avatar", item);
                    break;

                case "banner":
                    UserDataScript.setInfo("banner", item);
                    break;

                case "ficha":
                    UserDataScript.setInfo("ficha", item);
                    break;

                default:
                    ErrorDataScript.setErrorText("Error. Vuelve a intentarlo.");
                    ErrorDataScript.setButtonMode(1);
                    SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
                    break;
                }

                checkActualItem();
            }
        }
        else
        {
            ErrorDataScript.setErrorText("Objeto no reconocido");
            ErrorDataScript.setButtonMode(1);
            SceneManager.LoadScene("Error Scene", LoadSceneMode.Additive);
        }
    }