예제 #1
0
        /// <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);
        }
예제 #2
0
    public void Loadptions()
    {
        string optionsAsJson;

        if (PlayerPrefs.HasKey("GameOptions"))
        {
            optionsAsJson = PlayerPrefs.GetString("GameOptions");
        }
        else
        {
            optionsAsJson = Uteis.LoadJson("options");
        }
        _options = JsonUtility.FromJson <GameOptions>(optionsAsJson);
    }
예제 #3
0
    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);
    }
예제 #4
0
    private void LoadUser()
    {
        string userAsJson;

        if (PlayerPrefs.HasKey("User"))
        {
            userAsJson = PlayerPrefs.GetString("User");
        }
        else
        {
            userAsJson = Uteis.LoadJson("usuario");
        }
        _user = JsonUtility.FromJson <User>(userAsJson);
    }
예제 #5
0
        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);
        }