예제 #1
0
        /// <summary> Change user profile picture, then automatically execute GetMe(). </summary>
        public static void ChangeUserPicture(Texture2D picture)
        {
            WebCall call = new WebCall(BaseURL + API.MeChange, CreateBaseHeaders(), null, (x) => DataManager.Me.FetchData(true), true);

            if (picture != null)
            {
                call.SetImage(picture);
            }
            else
            {
                call.PostDictionary["image_uuid"] = "remove";
            }

            ExecuteWebCall(call);
        }
예제 #2
0
        public static void SubmitAssignment(int id, string text, Texture2D picture)
        {
            Dictionary <string, object> postData = new Dictionary <string, object>();

            if (!string.IsNullOrEmpty(text))
            {
                postData["answer"] = text;
            }

            string  url  = BaseURL + API.AssignmentDone.Replace("{id}", id.ToString());
            WebCall call = new WebCall(url, CreateBaseHeaders(), postData, HandleSubmitAssignment);

            if (picture != null)
            {
                call.SetImage(picture);
            }

            ExecuteWebCall(call);
        }