コード例 #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);
        }