Esempio n. 1
0
    void GetGame()
    {
        Bmob.Get <BmobGameObject> (TABLENAME, "68ee8131ca", (resp, exception) =>
        {
            if (exception != null)
            {
                print("查询失败, 失败原因为: " + exception.Message);
                return;
            }

            BmobGameObject game = resp;
            print("获取的对象为: " + toString(game));
        });
    }
Esempio n. 2
0
    /// <summary>
    /// 查询数据
    /// </summary>
    public T getRecoard <T>(string objectId, string tabName) where T : BmobTable
    {
        T game = null;

        Bmob.Get <T>(tabName, objectId, (resp, exception) =>
        {
            if (exception != null)
            {
                Debug.Log("查询失败, 失败原因为: " + exception.Message);
                return;
            }
            game = resp;
        });
        return(game);
    }
Esempio n. 3
0
    /// <summary>
    /// Tos the get bmob data.
    /// </summary>
    void ToGetBmobData()
    {
        Bmob.Get <BmobGameObject>(TABLENAME, objectId,
                                  (response, exception) => {
            if (exception != null)
            {
                print("数据获取失败" + exception);
                return;
            }

            print("数据获取成功");

            //获取Bmob的用户数据,并且赋值给UI
            userNmaeText.text = response.userName;
            coinText.text     = response.coin.ToString();
        }
                                  );
    }
Esempio n. 4
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);
            }
        }
                                  );
    }