public static void ExecuteGenSqlite()
        {
            var outpath_win =
                IPath.Combine(Application.streamingAssetsPath, BDUtils.GetPlatformPath(Application.platform));

            Excel2SQLiteTools.GenSQLite(outpath_win);

            var outpath_android = Application.streamingAssetsPath + "/" +
                                  BDUtils.GetPlatformPath(RuntimePlatform.Android) + "/Local.db";
            var outpath_ios = Application.streamingAssetsPath + "/" +
                              BDUtils.GetPlatformPath(RuntimePlatform.IPhonePlayer) + "/Local.db";
            var source = outpath_win + "/Local.db";

            var bytes = File.ReadAllBytes(source);

            if (source != outpath_android)
            {
                FileHelper.WriteAllBytes(outpath_android, bytes);
            }
            if (source != outpath_ios)
            {
                FileHelper.WriteAllBytes(outpath_ios, bytes);
            }

            AssetDatabase.Refresh();
        }
Пример #2
0
        public void OnGUI()
        {
            GUILayout.BeginVertical();
            GUILayout.Label("3.表格打包", EditorGUIHelper.TitleStyle);
            GUILayout.Space(5);
            if (GUILayout.Button("表格导出成Sqlite", GUILayout.Width(300), GUILayout.Height(30)))
            {
                var outPath = Application.persistentDataPath + "/" + BDUtils.GetPlatformPath(RuntimePlatform.Android);
                //3.打包表格
                Excel2SQLiteTools.GenSQLite(outPath);
            }

            GUILayout.EndVertical();
        }