void UpdateGame() { BmobGameObject game = new BmobGameObject(); game.playerName = "pn_123"; Bmob.Update(TABLENAME, "58b84a1e12", game, (resp, exception) => { if (exception != null) { print("保存失败, 失败原因为: " + exception.Message); return; } print("保存成功, @" + resp.updatedAt); }); }
void UpdateData() { BmobGameObject game = new BmobGameObject(); game.userId = 11; game.userName = "******"; Bmob.Update(TABLENAME, "838951fe45", game, (resp, exception) => { if (exception != null) { print("数据更新失败:" + exception); return; } print("数据更新成功"); } ); }
void createOpCallback() { var data = new BmobGameObject(); System.Random rnd = new System.Random(); data.score = rnd.Next(-50, 170); data.playerName = "123"; data.cheatMode = false; // /ok callback // Bmob.Create(TABLENAME, data, (resp, exception) => // { // if(exception != null){ // print("保存失败, 失败原因为: " + exception.Message); // return; // } // // print("保存成功, @" + resp.createdAt); // }); }
void createOpCallback() { var data = new BmobGameObject (); System.Random rnd = new System.Random (); data.score = rnd.Next (-50, 170); data.playerName = "123"; data.cheatMode = false; // /ok callback // Bmob.Create(TABLENAME, data, (resp, exception) => // { // if(exception != null){ // print("保存失败, 失败原因为: " + exception.Message); // return; // } // // print("保存成功, @" + resp.createdAt); // }); }
void addData() { var data = new BmobGameObject(); data.userId = 2; data.userName = "******"; Bmob.Create(TABLENAME, data, (resp, exception) => { if (exception != null) { print("加载失败"); } else { print("加载成功" + resp.createdAt + exception); } } ); }
//private string usernameid; void add_data(int thisscore) //在数据库中增加数据方法 { var new_data = new BmobGameObject(); new_data.userId = PlayerPrefs.GetString(typeof(name_pass) + "Id"); new_data.myscore = thisscore; Bmob.Create(TABLENAME, new_data, (resp, exception) => { if (exception != null) { print("fail" + exception.Message); return; } Debug.Log("创建成功"); } ); }
void create() { var data = new BmobGameObject (); System.Random rnd = new System.Random (); data.score = rnd.Next (-50, 170); data.playerName = "123"; data.cheatMode = false; Bmob.Create (TABLENAME, data, (resp, exception) => { if (exception != null) { print ("保存失败, 失败原因为: " + exception.Message); return; } print ("保存成功, @" + resp.createdAt); } ); //Bmob.CreateTaskAsync (TABLENAME, data); }
void SelectData() { Bmob.Get <BmobGameObject>(TABLENAME, "838951fe45", (resp, exception) => { if (exception != null) { print("查询失败"); } else { print("查询成功"); BmobGameObject data = resp; print(data); print(data.userName); print(data.userId); print(data.objectId); print(data.createdAt); } } ); }
void create() { var data = new BmobGameObject(); System.Random rnd = new System.Random(); data.score = rnd.Next(-50, 170); data.playerName = "123"; data.cheatMode = false; Bmob.Create(TABLENAME, data, (resp, exception) => { if (exception != null) { print("保存失败, 失败原因为: " + exception.Message); return; } print("保存成功, @" + resp.createdAt); } ); //Bmob.CreateTaskAsync (TABLENAME, data); }
// Update is called once per frame void Update() { //测试使用的 if (Input.GetMouseButtonDown(0)) { BmobGameObject user = new BmobGameObject(); user.userid = "LIC"; user.password = 212; AddUser(user); } if (Input.GetMouseButtonDown(1)) { SearchUser(); } if (Input.GetMouseButtonDown(2)) { BmobGameObject user = new BmobGameObject(); user.userid = "LIC"; user.password = 212; Login(user, (isok) => { Debug.Log(isok); }); } }
void UpdateGame() { BmobGameObject game = new BmobGameObject (); game.playerName = "pn_123"; Bmob.Update (TABLENAME, "68ee8131ca", game, (resp, exception) => { if (exception != null) { print ("保存失败, 失败原因为: " + exception.Message); return; } print ("保存成功, @" + resp.updatedAt); }); }