Пример #1
0
    public void PushSave(string data)
    {
        GameUser user = BmobUser.CurrentUser as GameUser;

        if (user != null)
        {
            user.SaveData = data;
            user.Level    = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>().CurrentLevel;
            bmob.UpdateUser(user, (callbackData, ex) => {
                if (ex != null)
                {
                    print("保存失败, 失败原因为: " + ex.Message);
                    return;
                }
                print("保存成功, @" + callbackData.updatedAt);
            });
        }
    }
Пример #2
0
    void updateuser()
    {
        Bmob.Login <MyBmobUser> ("test", "123456", (resp, ex) =>
        {
            print(resp.sessionToken);
            MyBmobUser u = new MyBmobUser();
            u.attack     = 1000;
            Bmob.UpdateUser(resp.objectId, u, resp.sessionToken, (updateResp, updateException) =>
            {
                if (updateException != null)
                {
                    print("保存失败, 失败原因为: " + updateException.Message);
                    return;
                }

                print("保存成功, @" + updateResp.updatedAt);
            });
        });
    }