Commit 1e0abe38 by alsunj

Upload New File

parent 32f3b01c
Showing with 40 additions and 0 deletions
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SaveScript : MonoBehaviour
{
public void Savegame()
{
StartCoroutine(SavetoDB());
}
IEnumerator SavetoDB()
{
WWWForm form = new WWWForm();
form.AddField("username", DBmanager.username);
form.AddField("bank", DBmanager.bank);
form.AddField("loses", DBmanager.loses);
form.AddField("wins", DBmanager.wins);
WWW www = new WWW("http://localhost/save.php", form);
yield return www;
if (www.text[0] == '0')
{
UnityEngine.SceneManagement.SceneManager.LoadScene(3);
}
else
{
Debug.Log("sisselogimine ei nnestunud xx" + www.text);
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment