Beispiel #1
0
        void CallBackUpdate(string response)
        {
            if (response == "")
            {
                return;
            }
            DuelUserModel duelUserModel = JsonUtility.FromJson <DuelUserModel>(response);

            print(duelUserModel);
        }
Beispiel #2
0
        public void create(DuelUserModel duelUserModel)
        {
            WWWForm form = new WWWForm();

            form.AddField("user_from_id", duelUserModel.user_from_id);
            form.AddField("user_to_id", duelUserModel.user_to_id);
            form.AddField("status", duelUserModel.status);
            form.AddField("init_date", duelUserModel.init_date);
            form.AddField("end_date", duelUserModel.end_date);
            form.AddField("user_won", duelUserModel.user_won);
            form.AddField("durability_lost", duelUserModel.durability_lost);
            form.AddField("cash_lost", duelUserModel.cash_lost);
            form.AddField("hungry_cost", duelUserModel.hungry_cost);
            form.AddField("tired_cost", duelUserModel.tired_cost);
            httpHandlerScript.POST(Config.apiUrl + "duelsUsers/store", CallBackCreate, form);
        }