找回密码
 立即注册
查看: 377|回复: 0

解决unity离线文档打开慢的问题

[复制链接]
发表于 2021-2-4 09:33 | 显示全部楼层 |阅读模式
unity离线文档打开慢是因为本地文档会访问谷歌的服务器, 将所有html文件里的相关代码删除即可
  1. using System;
  2. using System.IO;
  3. using System.Text;
  4. namespace Tool
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             var rootFilePath = "C:/Users/****/Desktop/UnityDocumentation";
  11.             foreach (var htmlFilePath in Directory.EnumerateFiles(rootFilePath, "*.html", SearchOption.AllDirectories))
  12.             {
  13.                 var htmlText = File.ReadAllText(htmlFilePath);
  14.                 var newHtmlText = htmlText.Replace(
  15.                     "</script><link href=\"https://fonts.googleapis.com/css?family=Roboto&display=swap\" rel=\"stylesheet\">", "");
  16.                 File.WriteAllText(htmlFilePath, newHtmlText, Encoding.UTF8);
  17.             }
  18.         }
  19.     }
  20. }
复制代码
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-9-20 14:26 , Processed in 0.089167 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表