示例#1
0
    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);
        });
    }
示例#2
0
    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("数据更新成功");
        }
                    );
    }
示例#3
0
    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);
//        });
    }
示例#4
0
    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);
        //        });
    }
示例#5
0
    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);
            }
        }
                    );
    }
示例#6
0
        //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("创建成功");
            }
                        );
        }
示例#7
0
    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);
    }
示例#8
0
    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);
            }
        }
                                  );
    }
示例#9
0
    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);
    }
示例#10
0
 // 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);
         });
     }
 }
示例#11
0
    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);
                });
    }