コード例 #1
0
    private IEnumerator _sendQuestionCoroutine(string text)
    {
        var wwwForm = new WWWForm();

        wwwForm.AddField("text", text);
        wwwForm.AddField("email", PlayerPrefs.GetString("email"));

        var www = new WWW(InfoStorage.Server + InfoStorage.QuestionApi, wwwForm);

        yield return(www);

        if (www.error == null)
        {
            AnimationAssistant.QuestionAnimation(_form, _success);
        }
        else
        {
            _questions.Enqueue(text);
            EventStorage.Instance.ConnectionEstablished.AddListener(_sendAllCachedQuestions);
            AnimationAssistant.QuestionAnimation(_form, _failure);
        }
    }