{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-loading-check-consistency-editor-cost#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost.md",
  "context": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-loading-check-consistency-editor-cost",
  "slug": "uwa-answer-loading-check-consistency-editor-cost",
  "title": "loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "f32bc76be8d721ada79d1edf4a5ce4cde8324ed9d5dc6b8eae486720869497cb",
  "assets": [
    {
      "reference": "assets/609cf2106bb31032f97916f2/01.png",
      "url": "/media/7f9f77529e2d00f1acb5.png",
      "mediaType": "image/png",
      "contentHash": "7f9f77529e2d00f1acb58b9d7e27084e8fc9f42806d3da297b50f503b5dcb6af",
      "byteLength": 40779,
      "width": 1059,
      "height": 243
    },
    {
      "reference": "assets/609cf2106bb31032f97916f2/02.png",
      "url": "/media/e9a45d01dc4537230382.png",
      "mediaType": "image/png",
      "contentHash": "e9a45d01dc4537230382b76f162b04924d41ef5974ccf85959c90616276021c0",
      "byteLength": 67934,
      "width": 685,
      "height": 801
    },
    {
      "reference": "assets/609cf2106bb31032f97916f2/03.png",
      "url": "/media/2a1e636d94d0888dee4f.png",
      "mediaType": "image/png",
      "contentHash": "2a1e636d94d0888dee4fab982bbb1e48bf95d2df264fdbc2ed628860b479e1f1",
      "byteLength": 90765,
      "width": 903,
      "height": 503
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化",
      "anchor": "loadingcheckconsistency-editor-only-编辑器上这个比较耗时请问是做什么的如何优化",
      "citation": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/#loadingcheckconsistency-editor-only-%E7%BC%96%E8%BE%91%E5%99%A8%E4%B8%8A%E8%BF%99%E4%B8%AA%E6%AF%94%E8%BE%83%E8%80%97%E6%97%B6%E8%AF%B7%E9%97%AE%E6%98%AF%E5%81%9A%E4%BB%80%E4%B9%88%E7%9A%84%E5%A6%82%E4%BD%95%E4%BC%98%E5%8C%96"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "claims": [],
  "outgoing": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "上位集合：我的 UWA 问答",
      "citation": "https://www.pystone.net/notes/uwa-answer-loading-check-consistency-editor-cost/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "incoming": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "2021-05-14：loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化（资源管理）",
      "citation": "https://www.pystone.net/notes/my-uwa-answers/#2021"
    },
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "我的UWA问答中的“2021-05-14 - loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\n![image.png](assets/609cf2106bb31032f97916f2/01.png)\n\n- 提问者：cccccc\n- 提问时间：2021-05-14 01:32:00\n\n## 我的回答\n\n我把之前的回答Copy过来好了（https://answer.uwa4d.com/question/60963d386bb31032f979156e）：\n\nReadObject实际上是在加载之后，对Object进行反序列化。一个prefab反序列化后，会有大量的Object。IntegrateAllThreadedObjects会遍历这些Object，而Loading.CheckConsistency就是在遍历这些Object时，对数据进行一致性检验。\n\n所谓一致性检验，就是比如，对下图prefab的序列化文件，会检查两个红框中的fileID是否一致。\n\n![image.png](assets/609cf2106bb31032f97916f2/02.png)\n\n图片来源：https://www.cnblogs.com/luguoshuai/p/12323186.html。 如这篇博文所讲，如果两个fileID不一致，会有CheckConsistency的报错。\n\n为什么只在Editor下进行一致性检验，而打包后Runtime不需要检验呢？ 笔者推测是在打包的时候已经对所有对象都检验过了，Runtime就不需要检验，也避免了检验带来的高耗时。\n\n证据如下图，某次打包的报错堆栈里面，包含了CheckConsistency的步骤：\n\n![image.png](assets/609cf2106bb31032f97916f2/03.png)\n\n图片来源：https://networm.me/2019/06/23/unity-has-stopped-working/\n\n- 回答时间：2021-05-14 02:09:47\n- 最后更新：2021-05-14 02:10:35\n- 采纳状态：已采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：资源管理\n- 原始问题：[loading.checkconsistency editor only 编辑器上这个比较耗时，请问是做什么的，如何优化](https://answer.uwa4d.com/question/609cf2106bb31032f97916f2)\n- 源页最后更新：2021-12-11 06:14:29\n"
}
