{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-asset-bundle-loading-methods#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods.md",
  "context": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-asset-bundle-loading-methods",
  "slug": "uwa-answer-asset-bundle-loading-methods",
  "title": "关于AssetBundle加载方式的适用环境",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "关于AssetBundle加载方式的适用环境",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "52f0ef56ba392658ff17fe37542e27ad69be333166ef7655a7df33f97f7a87fc",
  "assets": [],
  "headings": [
    {
      "depth": 1,
      "text": "关于AssetBundle加载方式的适用环境",
      "anchor": "关于assetbundle加载方式的适用环境",
      "citation": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods/#%E5%85%B3%E4%BA%8Eassetbundle%E5%8A%A0%E8%BD%BD%E6%96%B9%E5%BC%8F%E7%9A%84%E9%80%82%E7%94%A8%E7%8E%AF%E5%A2%83"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-asset-bundle-loading-methods/#%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-asset-bundle-loading-methods/#%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-03-23：关于AssetBundle加载方式的适用环境（内存管理）",
      "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-03-23 - 关于AssetBundle加载方式的适用环境”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# 关于AssetBundle加载方式的适用环境\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\nAssetBundle.LoadFromMemory以及AssetBundle.LoadFromSteam适用环境分别是什么？\n\n- 提问者：Hao\n- 提问时间：2021-03-20 22:00:43\n\n## 我的回答\n\n当资源有加密需求时，可先把AB读取到内存当中，进行解密后再调用该AssetBundle.LoadFromMemory 进行加载。该方法消耗的最大内存量将至少是AssetBundle的两倍。可参考：https://blog.uwa4d.com/archives/USparkle_Addressable3.html。\n\nAssetBundle.LoadFromStream可进行流式加载，不需要将AB全部读到内存中再解密、加载，而是可以通过每次像Buffer中读一部分，解密一部分的方式进行加载，不会多占用一份很大的内存。如果使用该接口，需要自定义一个继承FileStream类，然在Read和Write方法内对byte数组进行异或加密解密处理。\n\n具体用法可参考：\n\nhttps://www.xuanyusong.com/archives/4607\n\n- 回答时间：2021-03-23 01:26:39\n- 最后更新：2021-03-23 01:26:39\n- 采纳状态：未采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：内存管理\n- 原始问题：[关于AssetBundle加载方式的适用环境](https://answer.uwa4d.com/question/60558f8bcfa35d5b53669b6b)\n- 源页最后更新：2021-03-23 01:26:39\n"
}
