mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 11:48:29 +00:00
17 lines
24 KiB
HTML
17 lines
24 KiB
HTML
<!doctype html>
|
||
<html lang="zh" dir="ltr" class="docs-wrapper docs-doc-page docs-version-2.4.0 plugin-docs plugin-id-default docs-doc-id-breaking-change">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<meta name="generator" content="Docusaurus v2.0.0-beta.20">
|
||
<title data-rh="true">破坏性变更 | Cocos Enhance Kit</title><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://smallmain.github.io/cocos-enhance-kit/docs/2.4.0/breaking-change"><meta data-rh="true" name="docusaurus_locale" content="zh"><meta data-rh="true" name="docsearch:language" content="zh"><meta data-rh="true" name="docusaurus_version" content="2.4.0"><meta data-rh="true" name="docusaurus_tag" content="docs-default-2.4.0"><meta data-rh="true" name="docsearch:version" content="2.4.0"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-2.4.0"><meta data-rh="true" property="og:title" content="破坏性变更 | Cocos Enhance Kit"><meta data-rh="true" name="description" content="一般情况下都不需要了解。"><meta data-rh="true" property="og:description" content="一般情况下都不需要了解。"><link data-rh="true" rel="icon" href="/cocos-enhance-kit/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://smallmain.github.io/cocos-enhance-kit/docs/2.4.0/breaking-change"><link data-rh="true" rel="alternate" href="https://smallmain.github.io/cocos-enhance-kit/docs/2.4.0/breaking-change" hreflang="zh"><link data-rh="true" rel="alternate" href="https://smallmain.github.io/cocos-enhance-kit/docs/2.4.0/breaking-change" hreflang="x-default"><link rel="stylesheet" href="/cocos-enhance-kit/assets/css/styles.22998370.css">
|
||
<link rel="preload" href="/cocos-enhance-kit/assets/js/runtime~main.e047e124.js" as="script">
|
||
<link rel="preload" href="/cocos-enhance-kit/assets/js/main.a7d7118a.js" as="script">
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
|
||
<div role="region"><a href="#" class="skipToContent_ZgBM">跳到主要内容</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/cocos-enhance-kit/"><b class="navbar__title text--truncate">Cocos Enhance Kit</b></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/cocos-enhance-kit/">首页</a><a class="navbar__item navbar__link navbar__link--active" href="/cocos-enhance-kit/docs/2.4.0/intro">文档</a><a href="https://smallmain.github.io/cocos-enhance-kit/demo/v1.0.0/web-desktop/index.html" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">演示</a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__link" aria-haspopup="true" aria-expanded="false" role="button" href="/cocos-enhance-kit/docs/2.4.0/intro">2.4.0</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/next/breaking-change">Next</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/breaking-change">3.0.0</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/cocos-enhance-kit/docs/2.4.0/breaking-change">2.4.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/2.3.0/breaking-change">2.3.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/2.2.0/breaking-change">2.2.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/2.1.0/breaking-change">2.1.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/2.0.0/breaking-change">2.0.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/1.2.0/intro">1.2.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/1.1.0/intro">1.1.0</a></li><li><a class="dropdown__link" href="/cocos-enhance-kit/docs/1.0.0/intro">1.0.0</a></li></ul></div><a href="https://github.com/smallmain/cocos-enhance-kit" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link">Github</a><div class="searchBox_dLyj"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="搜索" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div><div class="searchHintContainer_Pkmr"><kbd class="searchHint_iIMx">ctrl</kbd><kbd class="searchHint_iIMx">K</kbd></div></div></div><div class="toggle_S7eR colorModeToggle_vKtC"><button class="clean-btn toggleButton_rCf9 toggleButtonDisabled_Pu9x" type="button" disabled="" title="切换浅色/暗黑模式(当前为浅色模式)" aria-label="切换浅色/暗黑模式(当前为浅色模式)"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_v35p"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_nQuB"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div class="main-wrapper docsWrapper_mKqt"><button aria-label="回到顶部" class="clean-btn theme-back-to-top-button backToTopButton_RiI4" type="button"></button><div class="docPage_ualW"><aside class="theme-doc-sidebar-container docSidebarContainer_UQUJ"><div class="sidebar_RiAD"><nav class="menu thin-scrollbar menu_izAj"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/cocos-enhance-kit/docs/2.4.0/intro">介绍</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="true" href="/cocos-enhance-kit/docs/2.4.0/installation/installation-auto">安装</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/installation/installation-auto">一键安装</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/installation/installation-manual">手动安装</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="true" href="/cocos-enhance-kit/docs/2.4.0/best-practices/performance-guide">最佳实践</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/best-practices/performance-guide">提升游戏性能</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/best-practices/quality-guide">提升游戏质量</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/best-practices/new-features">新引擎特性</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="true" href="/cocos-enhance-kit/docs/2.4.0/user-guide/multi-render/multi-render-intro">使用指南</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/multi-render/multi-render-intro">多纹理渲染</a><button aria-label="打开/收起侧边栏菜单「多纹理渲染」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/text-render/text-render-intro">文本渲染</a><button aria-label="打开/收起侧边栏菜单「文本渲染」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/dynamic-batcher/dynamic-batcher-intro">动态合图</a><button aria-label="打开/收起侧边栏菜单「动态合图」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/spine/spine-intro">Spine</a><button aria-label="打开/收起侧边栏菜单「Spine」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/tiledmap/tiledmap-intro">TiledMap</a><button aria-label="打开/收起侧边栏菜单「TiledMap」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/cocos-enhance-kit/docs/2.4.0/user-guide/multithread/thread-intro">多线程支持</a><button aria-label="打开/收起侧边栏菜单「多线程支持」" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/cocos-enhance-kit/docs/2.4.0/breaking-change">破坏性变更</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/cocos-enhance-kit/docs/2.4.0/uninstall-guide">卸载</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/cocos-enhance-kit/docs/2.4.0/update-log">更新日志</a></li></ul></nav></div></aside><main class="docMainContainer_uL0j"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_DM6M"><div class="theme-doc-version-banner alert alert--warning margin-bottom--md" role="alert"><div>此为 <!-- -->Cocos Enhance Kit<!-- --> <b>2.4.0</b> 版的文档,现已不再积极维护。</div><div class="margin-top--md">最新的文档请参阅 <b><a href="/cocos-enhance-kit/docs/breaking-change">最新版本</a></b> (<!-- -->3.0.0<!-- -->)。</div></div><div class="docItemContainer_vinB"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Xlws" aria-label="页面路径"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="主页面" class="breadcrumbs__link" href="/cocos-enhance-kit/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_kU5B"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">破坏性变更</span><meta itemprop="position" content="1"></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">版本:2.4.0</span><div class="tocCollapsible_bZGK theme-doc-toc-mobile tocMobile_TmEX"><button type="button" class="clean-btn tocCollapsibleButton_l22C">本页总览</button></div><div class="theme-doc-markdown markdown"><h1>破坏性变更</h1><p>在添加新特性的过程中,有些变化在所难免,你可以浏览本文档以进行评估是否会对项目造成影响。</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="默认禁用原生-ttf-渲染器">默认禁用原生 TTF 渲染器<a class="hash-link" href="#默认禁用原生-ttf-渲染器" title="标题的直接链接"></a></h2><p>引擎的 Label 在使用 Char 缓存模式并且使用 TTF 字体时,会使用一个原生 TTF 渲染器。</p><p>这个渲染器理论上能提升原生平台的 Label 性能,但仅在 Char 缓存模式并且还要使用 TTF 字体时才生效,这也导致了在原生平台上字体样式可能与其它平台不一致的问题。</p><p>在重构 CHAR 缓存模式时考虑到这些因素和人力有限的原因,我们暂时不打算适配这个原生 TTF 渲染器,所以直接默认禁用了原生 TTF 渲染器,这个禁用是官方提供的接口,不会造成其它问题。</p><p><strong>大部分项目可以不用关心</strong>。</p><div class="language-js codeBlockContainer_MPoW theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_B9tL"><pre tabindex="0" class="prism-code language-js codeBlock__0OG thin-scrollbar"><code class="codeBlockLines_gEuF"><span class="token-line" style="color:#393A34"><span class="token plain">cc</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">macro</span><span class="token punctuation" style="color:#393A34">.</span><span class="token constant" style="color:#36acaa">ENABLE_NATIVE_TTF_RENDERER</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">false</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_hRr1"><button type="button" aria-label="复制代码到剪贴板" title="复制" class="clean-btn"><span class="copyButtonIcons_W9eQ" aria-hidden="true"><svg class="copyButtonIcon_XEyF" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_i9w9" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_mojV" id="动态图集的一些变化">动态图集的一些变化<a class="hash-link" href="#动态图集的一些变化" title="标题的直接链接"></a></h2><p>对动态图集的重构虽然保留了所有原有的公开接口,但实现细节与以前不同了。</p><p>如果你的项目有在细致地管理动态图集,请注意以下几点:</p><ul><li><strong>如果你有手动修改 <code>cc.dynamicAtlasManager.maxAtlasCount</code> 属性,请考虑删除</strong></li></ul><p>社区版会根据设备最大纹理数和 Char 缓存模式字符图集的相关设置自动调整动态合图的最大图集数量。</p><p>这不意味着你不能手动调整了,而是建议你阅读新动态图集和新 Char 缓存模式相关的文档后再考虑是否有必要进行调整。</p><p>关于这个你可以查看 <a href="/cocos-enhance-kit/docs/2.4.0/best-practices/performance-guide">提升项目性能</a> 了解。</p><ul><li><strong>动态图集重复纹理的判断从 <code>texture._id</code> 改为使用 <code>texture._uuid</code></strong></li></ul><p>具体的设计原因和原理可查看动态合图的原理文档。</p><ul><li><strong><code>cc.dynamicAtlasManager.insertSpriteFrame(spriteFrame)</code> 不再检查纹理的 <code>packable</code> 属性</strong></li></ul><p>并不是说 <code>packable</code> 属性无效了,而是 <code>insertSpriteFrame</code> 现在作为将纹理强制加入动态图集的接口使用。</p><ul><li><strong>如果你的项目依赖动态图集的内部实现细节,请重新检查相关代码</strong></li></ul><p>比如你的项目依赖一些动态图集未公开的类或者接口(引擎在 <code>creator.d.ts</code> 声明了的则是已经公开的),则可能需要重新编写。</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="char-缓存模式的一些变化">Char 缓存模式的一些变化<a class="hash-link" href="#char-缓存模式的一些变化" title="标题的直接链接"></a></h2><p>对 Char 缓存模式也进行了重构,内部变化比较大。</p><ul><li><strong>暂不支持自定义材质</strong></li></ul><p>如果项目中有组件在使用 Char 缓存模式并且设置了自定义材质则可能会失效,具体原因可前往 <a href="/cocos-enhance-kit/docs/2.4.0/user-guide/text-render/text-char-mode">新的 Char 缓存模式</a> 文档进行了解。</p><ul><li><strong>如果你的项目依赖 Char 缓存模式的内部实现细节,请重新检查相关代码</strong></li></ul><p>比如你的项目依赖一些 Char 缓存模式未公开的类或者接口(引擎在 <code>creator.d.ts</code> 声明了的则是已经公开的),则可能需要重新编写。</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="材质-hash-计算的变化">材质 Hash 计算的变化<a class="hash-link" href="#材质-hash-计算的变化" title="标题的直接链接"></a></h2><p>在之前,材质的 Hash 发生变化时不会同时更新现有的材质变体 Hash,这导致在修改前创建的变体不能与修改后创建的变体合批(因为 Hash 不同)。</p><p>为了兼顾原生平台与 Web 平台,我们通过使材质本身的 Hash 值不变,并且改变变体的 Hash 计算方式来解决这个问题。</p><p>但这引入了新的问题:完全相同的两个材质不能合批。</p><p>比如你复制了一个 <code>multi-2d-sprite</code> 材质,分别使用这两个材质的组件不再会进行合批。</p><p>这种情况比较少见,如果你的项目发生了这种情况,可以手动将新材质的 Hash 值设置为旧材质的 Hash 值,即可让这两个材质合批。</p><h2 class="anchor anchorWithStickyNavbar_mojV" id="启用多线程时的破坏性改动">启用多线程时的破坏性改动<a class="hash-link" href="#启用多线程时的破坏性改动" title="标题的直接链接"></a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="资源管线">资源管线<a class="hash-link" href="#资源管线" title="标题的直接链接"></a></h3><p>当你启用多线程驱动资源管线时,<code>cacheManager</code> 的接口有以下不同:</p><ul><li><code>getTemp</code> 方法被 <code>getTempAsync</code> 方法代替,请检查你项目中相关的用法。</li><li>启用多线程之后,会使用多线程版的缓存管理器,如果你的项目访问了未暴露的内部属性,请检查相关的用法。</li></ul><h3 class="anchor anchorWithStickyNavbar_mojV" id="音频系统">音频系统<a class="hash-link" href="#音频系统" title="标题的直接链接"></a></h3><p>当你启用多线程驱动音频系统时,以下音频属性是定时更新而不是即时更新的:</p><ul><li><code>duration</code></li><li><code>currentTime</code></li></ul><p>这一般不会引起什么问题,无需特别关注。</p><p>如果你正在操作引擎内部维护的平台音频实例的话,需要注意现在的平台音频实例每个事件只支持有一个监听者(普通用户无需关注,AudioSource、CCAudio 等面向用户的 API 依然支持多个监听者)。</p></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="文档分页导航"><a class="pagination-nav__link pagination-nav__link--prev" href="/cocos-enhance-kit/docs/2.4.0/user-guide/multithread/thread-custom"><div class="pagination-nav__sublabel">上一页</div><div class="pagination-nav__label">自定义多线程扩展</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/cocos-enhance-kit/docs/2.4.0/uninstall-guide"><div class="pagination-nav__sublabel">下一页</div><div class="pagination-nav__label">卸载</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_cNA8 thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#默认禁用原生-ttf-渲染器" class="table-of-contents__link toc-highlight">默认禁用原生 TTF 渲染器</a></li><li><a href="#动态图集的一些变化" class="table-of-contents__link toc-highlight">动态图集的一些变化</a></li><li><a href="#char-缓存模式的一些变化" class="table-of-contents__link toc-highlight">Char 缓存模式的一些变化</a></li><li><a href="#材质-hash-计算的变化" class="table-of-contents__link toc-highlight">材质 Hash 计算的变化</a></li><li><a href="#启用多线程时的破坏性改动" class="table-of-contents__link toc-highlight">启用多线程时的破坏性改动</a><ul><li><a href="#资源管线" class="table-of-contents__link toc-highlight">资源管线</a></li><li><a href="#音频系统" class="table-of-contents__link toc-highlight">音频系统</a></li></ul></li></ul></div></div></div></div></main></div></div></div>
|
||
<script src="/cocos-enhance-kit/assets/js/runtime~main.e047e124.js"></script>
|
||
<script src="/cocos-enhance-kit/assets/js/main.a7d7118a.js"></script>
|
||
</body>
|
||
</html> |