/// <summary> /// Initializes a new instance of the <see cref="T:Trilhas.Utilities.Connection"/> class. /// </summary> void Awake() { Instance = this; DontDestroyOnLoad(gameObject); string strJsonConfig = Uteis.LoadJson("config"); _objConfig = JsonUtility.FromJson <Config>(strJsonConfig); }
public void Loadptions() { string optionsAsJson; if (PlayerPrefs.HasKey("GameOptions")) { optionsAsJson = PlayerPrefs.GetString("GameOptions"); } else { optionsAsJson = Uteis.LoadJson("options"); } _options = JsonUtility.FromJson <GameOptions>(optionsAsJson); }
public static void LoadUser(out User user) { string userAsJson; if (PlayerPrefs.HasKey("User")) { userAsJson = PlayerPrefs.GetString("User"); } else { userAsJson = Uteis.LoadJson("usuario"); } user = JsonUtility.FromJson <User>(userAsJson); }
private void LoadUser() { string userAsJson; if (PlayerPrefs.HasKey("User")) { userAsJson = PlayerPrefs.GetString("User"); } else { userAsJson = Uteis.LoadJson("usuario"); } _user = JsonUtility.FromJson <User>(userAsJson); }
public IEnumerator GetPerguntasQuiz(string pedido) { //TODO: Fazer funcionar o a aquisicao de perguntas pelo servidor /* * _jsonResponse = null; * isDone = false; * WWWForm form = new WWWForm(); * if (Token != null) * { * * form.AddField("token", Token); * form.AddField("pedido", "ec9be43e-16d0-43b2-86b5-1d217e77fcae"); * yield return StartCoroutine(SendData("perguntasquiz.php", form)); * } * else * { * Debug.LogWarning("There is no token to send!"); * yield return null; * }*/ _jsonResponse = Uteis.LoadJson("quiz_1"); yield return(null); }