Exemplo n.º 1
0
        public IEnumerator PostComment(UserComment comment, Action<bool> resultAction)
        {
            var jsonString = JsonConvert.SerializeObject(comment);

            var headers = new Dictionary<string, string>();
            headers.Add("Content-Type", "text/json");

            var encoding = new UTF8Encoding();
            var request = new WWW(CommentUrl, encoding.GetBytes(jsonString), headers);

            yield return request;

            if (request.error != null)
            {
                Debug.Log("Error:" + request.error);
                resultAction(false);
            }
            else
            {
                Debug.Log("Request Successful");
                Debug.Log(request.text);
                resultAction(true);
            }

        }
Exemplo n.º 2
0
    public void SetComment(UserComment comment)
    {
        _comment = comment;
        if (comment.WorldPositon == null) comment.WorldPositon = "(52,0,0)";

        transform.position = comment.WorldPositon.ParseToVector3();
    }