Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        asyncDB = new SQLiteAsync();

        // open database
        asyncDB.Open(ExtensionMethods.AppWritableDirectory() + "/demo_for_async_db.db", null, null);

        // create test table.
        asyncDB.Query(queryCreate, CreateQueryCreated, null);
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        asyncDB = new SQLiteAsync();

        // open database
        asyncDB.Open(Application.persistentDataPath + "/demo_for_async_db.db", null, null);

        // create test table.
        asyncDB.Query(queryCreate, CreateQueryCreated, null);
    }
Beispiel #3
0
    void OnGUI()
    {
        if (demoData == null)
        {
            if (GUI.Button(new Rect(10, 10, 150, 70), "Run asynchronous"))
            {
                // that just show how to pass an object to callback.
                demoData = new TestCallbackData();

                // start from creation of 1000 records
                asyncDB.Query(queryInsert, InsertQueryCreated, demoData);
            }
        }


        // display frame count and records count - to show that game don't stop while we reading or writing.
        string log = "Please, press the button to run test.";

        if (demoData != null)
        {
            log = "Frame: " + frameCount + ", Record Count: " + demoData.Count;
        }
        GUI.Label(new Rect(10, 80, 600, 600), log);
    }
Beispiel #4
0
	// Use this for initialization
	void Start () {
		
		asyncDB = new SQLiteAsync();
		
		// open database
		asyncDB.Open(Application.persistentDataPath + "/demo_for_async_db.db");
		
		// create test table.
		asyncDB.Query(queryCreate, CreateQueryCreated, null);
	}