Unity3D如何串連Sqlite資料庫

來源:互聯網
上載者:User

環境介紹:

Windows7,Unity3D,SQLite Expert Personal 3

開發語言:

JavaScript

需要的dll檔案:

Mono.Data.Sqlite.dll和sqlite3.dll,dll檔案位置,截圖:

一定要在這個目錄下,請保持一致。

如果需要將編譯好的程式發布成功的話,需要改一些地方,具體見下面的截圖:

要改動的地方已用紅色標記,注意這個要改成.NET2.0,這樣才能夠發布的。系統預設的不是.NET2.0,這一點要注意!!!

下面來看下代碼吧,先看下如何建立資料庫的代碼,這一篇代碼是不用掛到任何對象上面去的,你只用把它當成一個工具即可。如下所示:

/*  Javascript class for accessing SQLite objects.             To use it, you need to make sure you COPY Mono.Data.SQLiteClient.dll from wherever it lives in your Unity directory             to your project's Assets folder             Originally created by dklompmaker in 2009             http://forum.unity3d.com/threads ... sier-Database-Stuff             Modified 2011 by Alan Chatham           */        //#pragma strict        /*

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.