Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        LocalDataTable ldt = new LocalDataTable("15", "content18885555", 5, "测试155888855", "2020-09-04 10:02:22:673");
        NetFileTable   nft = new NetFileTable(4, 2, "path444444", "1.0.0.1", 0, "测试4更新", "2020-09-04 10:02:22:677");

        //for (int i = 0; i < 2; i++)
        //{
        //    if (DBMgr.DefaultDB.Insert(new List<NetFileTable> { nft, nft, nft }) && DBMgr.DefaultDB.Insert(new List<LocalDataTable> { ldt, ldt, ldt }))
        //    {
        //        print("已经插入");
        //    }
        //    else
        //    {
        //        print("mei插入");
        //    }
        //}

        //print(to.Delete(nft));
        //print(to.Delete(ldt));

        //Dictionary<string, List<object>> d = new Dictionary<string, List<object>>();
        //d.Add("id", new List<object>(){"id", typeof(Int32), 5});
        //foreach (var item in DBMgr.DefaultDB.Select<NetFileTable>(d))
        //{
        //    print("" + item.id+" , " + item.remark);
        //}

        //print(DBMgr.DefaultDB.Insert(nft));


        // 测试下载byte
        //NetResMgr.DownloadBytes("http://127.0.0.1:8000/static/AppOne/123.jpg", (url, code, bs, objs) =>
        //{
        //    print(url);
        //    print(code);
        //    print(bs.Length);
        //    string path = LocalResPath.DIR_TEXTURE2D_PATH + Path.GetFileName(url);
        //    if (File.Exists(path))
        //        File.Delete(path);
        //    using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite))
        //    {
        //        using (BinaryWriter bw = new BinaryWriter(fs))
        //        {
        //            bw.Write(bs);
        //        }
        //    }

        //    DBMgr.CloseAll();
        //}, (progress) => { print(progress); }, new object[] { "测试下载" });

        //NetFileTable bb = new NetFileTable(0, 3, "wawa", null, (int)NetFileTable.FileDownloadState.Downloaded);
        //bool res = DBMgr.Instance.DefaultDB.Insert(bb);
        //print(res);
        //DBMgr.Instance.DefaultDB.Close();

        print("end");
        //StartCoroutine(IEnumGetTexture2D("http://127.0.0.1:8000/static/AppOne/123.jpg"));
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Awake()
    {
        screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z));
        SQLiteLoaderClient loader = new SQLiteLoaderClient();

        if (loader.Load("StreamingAssets/GameData/_game.db3"))
        {
            LocalDataTable.LoadAll(loader);
            LocalDataTable.LoadComplete();
            loader.Unload();
        }
    }