Hi all!
I’m developing a little platform game with Unity and C# but I’m quite new to these tools.
In order to have a ranking in my game, I implemented a SQL database with SQLite. Here some code to access the database:
public DbConnessione()
{
if (!File.Exists(Application.dataPath + "/" + DatabaseName))
{
SqliteConnection.CreateFile(Application.dataPath + "/" + DatabaseName);
ApriDb();
CreaTabella();
ChiudiDb();
}
}
public void ApriDb()
{
try
{
connection = "URI=file:" + Application.dataPath + "/" + Database;
dbconnection = new SqliteConnection(connection);
dbconnection.Open();
}
When I execute my code in Unity it works perfectly but when I build it and use it in the stand-alone .exe, it doesn’t work anymore. The game just freezes when it tries to open the database. I had a closer look at the exception retrieved and it addresses me to the sqlite3.dll.
I followed the instructions in the previous threads on the forum. which suggest to copy in the Assets/Plugins folder some dlls from the Unity program folder, but the game still doesn’t work.
I’ve already copied:
- All the I18N.dlls
- I updated sqlite3.dll to the 64 bit version.
- Mono.Security.dll
- System.data.dll
- Mono.data.sqlclient.dll
- Maybe something else too
This problem looks tricky and I’m really struggling on it. I hope someone may help me!
Thank you in advance.