private static void InitCoreResource(string cacheDir, string packageName, string destPath) { string path = Path.Combine(cacheDir, packageName); var url = WXConfig.moduleCDNPrefix + PluginHub.frameworkVersion + "/" + packageName + ".zip"; ProjectCreator.downloadAndUnpackWebURL(cacheDir, url); wxFileUtil.CopyDirectory(path, destPath); AssetDatabase.Refresh(); wxFileUtil.DeleteDirectory(path); }
// [MenuItem("test/Mock Download Resources")] public static void DownloadRes() { // var url = "https://res.wx.qq.com/wechatgame/product/webpack/userupload/20200609/193724/res.zip"; var url = WXConfig.moduleCDNPrefix + PluginHub.frameworkVersion + "/Bridge.zip"; // Debug.Log(url); var dist = new DirectoryInfo(Path.Combine(Application.dataPath, "__wx__tmp__res~")); // Debug.Log(dist); if (!dist.Exists) { dist.Create(); } ProjectCreator.downloadAndUnpackWebURL(dist.FullName, url); }