19 lines
24 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="zh" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-intro">
<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">
<link rel="alternate" type="application/rss+xml" href="/cocos-service-pack/blog/rss.xml" title="Cocos Service Pack RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/cocos-service-pack/blog/atom.xml" title="Cocos Service Pack Atom Feed"><title data-rh="true">介绍 | Cocos Service Pack</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-service-pack/docs/intro"><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="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="介绍 | Cocos Service Pack"><meta data-rh="true" name="description" content="logo"><meta data-rh="true" property="og:description" content="logo"><link data-rh="true" rel="icon" href="/cocos-service-pack/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://smallmain.github.io/cocos-service-pack/docs/intro"><link data-rh="true" rel="alternate" href="https://smallmain.github.io/cocos-service-pack/docs/intro" hreflang="zh"><link data-rh="true" rel="alternate" href="https://smallmain.github.io/cocos-service-pack/docs/intro" hreflang="x-default"><link rel="stylesheet" href="/cocos-service-pack/assets/css/styles.4efbebb6.css">
<link rel="preload" href="/cocos-service-pack/assets/js/runtime~main.646df9b0.js" as="script">
<link rel="preload" href="/cocos-service-pack/assets/js/main.a4840599.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-service-pack/"><div class="navbar__logo"><img src="/cocos-service-pack/img/logo.png" alt="Cocos Service Pack" class="themedImage_W2Cr themedImage--light_TfLj"><img src="/cocos-service-pack/img/logo.png" alt="Cocos Service Pack" class="themedImage_W2Cr themedImage--dark_oUvU"></div><b class="navbar__title text--truncate">Cocos Service Pack</b></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/cocos-service-pack/">首页</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/cocos-service-pack/docs/intro">文档</a><a href="https://smallmain.github.io/cocos-service-pack/demo/web-desktop/index.html" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">演示</a><a href="https://github.com/smallmain/cocos-service-pack" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link">加星鼓励</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_RiA
<a href="https://smallmain.github.io/cocos-service-pack/demo/web-mobile/index.html" target="_blank" rel="noopener noreferrer">手机版 Demo Web 项目</a></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="使用方法">使用方法<a class="hash-link" href="#使用方法" title="标题的直接链接"></a></h2><p>服务包通过自定义引擎的方式来修改引擎代码,你可以:</p><ul><li>通过我们发布的引擎扩展一键安装</li><li>下载源码包,使用里面的 Git Patch 文件进行安装</li></ul><p>具体教程可以参考 <a href="/cocos-service-pack/docs/installation-guide/installation-intro">安装指南</a></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="更新日志">更新日志<a class="hash-link" href="#更新日志" title="标题的直接链接"></a></h2><h3 class="anchor anchorWithStickyNavbar_mojV" id="service-pack-v100">Service Pack v1.0.0<a class="hash-link" href="#service-pack-v100" title="标题的直接链接"></a></h3><ul><li><strong>[新特性]<!-- --> 支持多纹理渲染</strong></li><li><strong>[新特性]<!-- --> 重构动态图集,支持多个新特性</strong></li><li><strong>[新特性]<!-- --> 重构 cc.Label 的 Char 缓存模式,支持多个新特性</strong></li><li><strong>[新特性]<!-- --> 支持高 DPI 文本渲染</strong></li><li><strong>[新特性]<!-- --> Spine 组件支持参与动态图集、与其它组件合批、使用 SpriteFrame 换装</strong></li><li>[新特性]<!-- --> cc.Label、cc.RichText、cc.Sprite、cc.MotionStreak、Spine 组件支持使用多纹理材质,并支持自动切换材质机制</li><li>[新特性]<!-- --> cc.RichText 支持使用自定义材质</li><li>[修复]<!-- --> 直接修改 Effect 的属性不回导致其变体的 hash 值刷新</li><li>[修复]<!-- --> CHAR 缓存模式 hash 计算可能会有重复的问题</li><li>[调整]<!-- --> 默认禁用 Label 原生 TTF 渲染器</li></ul><p>所有更新日志请移步 <a href="/cocos-service-pack/docs/update-log">此处</a></p><h2 class="anchor anchorWithStickyNavbar_mojV" id="贡献指南">贡献指南<a class="hash-link" href="#贡献指南" title="标题的直接链接"></a></h2><p>非常欢迎你能和我们一起来完善这个项目,所有的一切都通过 Github 进行:</p><ul><li>如果你有问题或者好的想法,请建立 <code>Issues</code> 或进入 <code>Discussions</code></li><li>如果你有新的代码提交,请建立 <code>Pull requests</code></li></ul><p>原则上允许对引擎的任何增强与修改,但是<strong>任何修改都必须兼容引擎原有的特性,不允许删除引擎原有的特性</strong>,并且请认真思考代码设计。</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>直接修改引擎可能是大部分人认为的下下策,比如我们常听到的一些声音:</p><ul><li>通过 “修改对象的原型” 等一些编程技巧做成一个插件脚本</li><li>没接触过自定义引擎,不知道该怎么用,感觉很可怕</li><li>我已经修改过引擎的某些部分了,不能直接安装</li></ul><p>以上问题我们都思考过,</p><p>首先,现在引擎的 2.x 版本已经停止了更新(仅做一些维护工作),也就是说修改引擎不会遇到在官方新版本发布后需要用大量时间去适配的情况。</p><p>其次,即使服务包中的所有改动都能做成一个插件脚本,但是无法兼容原生平台,并且一般都需要大量拷贝代码,包体会增大,可维护性可能会大幅降低。</p><p>最后,我们希望它接近 “原生” 的使用体验就像引擎本来就有的功能一样对于没有接触过自定义引擎的人我们提供的引擎扩展可以一键<E4B880><E994AE>
<script src="/cocos-service-pack/assets/js/runtime~main.646df9b0.js"></script>
<script src="/cocos-service-pack/assets/js/main.a4840599.js"></script>
</body>
</html>