跳至主要內容

BDFramework修改Sqlite可读写

Weekend小于 1 分钟UnityBDFramework

打开挂载在BDFrame上的BDLauncher脚本,定位到Launch函数,找到SqliteLoder.Load(),定位到SqliterLoader类中,添加一个函数

/// <summary>
/// runtime下加载,可读写
/// </summary>
/// <param name="str"></param>
static public void LoadReadWrite(AssetLoadPathType assetLoadPathTypeType)
{
    Connection?.Dispose();
    var path = GameConfig.GetLoadPath(assetLoadPathTypeType);

    //用当前平台目录进行加载
    path = GetLocalDBPath(path, Application.platform);
    if (File.Exists(path))
    {
        Connection = new SQLiteConnection(path, SQLiteOpenFlags.ReadWrite);
        BDebug.Log("DB加载路径:" + path, "red");
    }
    else
    {
        Debug.LogError("DB不存在:" + path);
    }
}

BDLauncher中的SqliteLoder.Load()替换成SqliteLoder.LoadReadWrite()

上次编辑于:
贡献者: Weekend