using System; using UnityEngine; using YooAsset; namespace GFGGame { public class SqliteController : SingletonBase { public void Init(bool logable, string resPath) { string dbPath = null; string connectionPath; #if UNITY_EDITOR dbPath = $"{Environment.CurrentDirectory}/{ResPathUtil.SQLITE_FILE_PATH}"; #else dbPath = GetSqlFilePath(resPath); #endif #if !UNITY_EDITOR && UNITY_ANDROID connectionPath = "uri=file:" + dbPath; #else connectionPath = "data source=" + dbPath; #endif SQLiteHelper.Instance.Init(logable, connectionPath); } private string GetSqlFilePath(string resPath) { RawFileOperationHandle handle = YooAssets.LoadRawFileSync(resPath); return handle.GetRawFilePath(); } } }