Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Serializable]
- public class Player
- {
- public string username;
- public string email;
- public string uid;
- public string game_data_json0;
- public string game_data_json1;
- public string game_data_json2;
- public string game_data_json3;
- }
- // Get cookies using GetCookie Jslib
- public string UID = "pirUJjkkId"; // Example
- public Player player;
- public IEnumerator SetScore()
- {
- WWWForm form = new WWWForm ();
- player.uid = UID;
- player.game_data_json0 = JsonUtility.ToJson (player, true); // Example
- Debug.Log ("I set: " + player.uid);
- string json = JsonUtility.ToJson (player, true);
- form.AddField ("arrayData", json);
- //CHANGE
- WWW www = new WWW ("http://example-name.com/db-unity/SetValue.php", form);
- yield return www;
- if (www.error != null) {
- Debug.Log ("Error: " + www.error);
- yield break;
- } else {
- Debug.Log ("Response: " + www.text);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement