make singleton

This commit is contained in:
pypy
2020-03-21 16:39:35 +09:00
parent 336241c4c7
commit a9d454308b
6 changed files with 36 additions and 5 deletions

View File

@@ -9,9 +9,15 @@ namespace VRCX
{
public class SQLite
{
public static SQLite Instance { get; private set; }
private static readonly ReaderWriterLockSlim m_Lock = new ReaderWriterLockSlim();
private static SQLiteConnection m_Connection;
static SQLite()
{
Instance = new SQLite();
}
public static void Init()
{
m_Connection = new SQLiteConnection($"Data Source={Application.StartupPath}/VRCX.sqlite;Version=3");