public static DcConf GetBdzConfModel(string pathName = "") { if (string.IsNullOrEmpty(pathName)) { pathName = Application.streamingAssetsPath + "/Conf/DcConf.json"; } string json = U_IO.ReadByFileToString(pathName); try { var jsonData = JsonMapper.ToObject(json); DcConf model = new DcConf { version = jsonData["version"].ToString(), sqlUrl = jsonData["sqlUrl"].ToString(), sqlPort = Convert.ToInt32(jsonData["sqlPort"].ToString()), sqlUser = jsonData["sqlUser"].ToString(), sqlPassword = jsonData["sqlPassword"].ToString(), sqlDb = jsonData["sqlDb"].ToString(), equipTable = jsonData["equipTable"].ToString() }; return(model); } catch (Exception e) { Debug.LogError(e); throw; } }
void OpenSql() { DcConf conf = DcConf.Ins; mySql = new U_MySQL(conf.sqlUrl, conf.sqlPort, conf.sqlUser, conf.sqlPassword, conf.sqlDb); mySql.OpenSql(); }