mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-24 10:48:27 +00:00
支持性扩展移至源码分支维护
This commit is contained in:
parent
f22c29d78c
commit
702fe8c43b
@ -12,11 +12,11 @@
|
||||
- `adapters` 小游戏平台适配器
|
||||
- `cocos2d-x` C++ 原生平台引擎
|
||||
- `creator-sp.d.ts` 引擎 TypeScript 类型提示
|
||||
- `extension` 支持性引擎扩展(v2.0 以上,之前版本的扩展源码请直接下载压缩包获取)
|
||||
|
||||
在 `master` 分支下:
|
||||
|
||||
- `src` 只留一份指向源码分支的说明文档
|
||||
- `extension` 支持性引擎扩展
|
||||
- `docs` 存放着文档网站源码,使用 Docusaurus 开发
|
||||
- `demo` 存放着 Cocos Creator 演示项目源码
|
||||
- `scripts` 工具脚本
|
||||
@ -58,7 +58,7 @@
|
||||
- 删除 `engine` 目录中的 `node_modules` 目录,可能导致解压失败。
|
||||
- 编译 JavaScript 引擎。
|
||||
- 编译原生模拟器。
|
||||
- 将几个源码目录、类型提示文件、`enhance-kit-support` 放到压缩包根目录内。
|
||||
- 将几个源码目录、类型提示文件、`extension` 放到压缩包根目录内。
|
||||
|
||||
### 更新 DEMO
|
||||
|
||||
|
@ -23,7 +23,7 @@ description: "需掌握一定的自定义引擎知识。"
|
||||
- `cocos2d-x`(Cocos2d-x engine)
|
||||
- `jsb-adapter`(JSB adpater)
|
||||
- `adapters`(Minigame adpaters)
|
||||
- `enhance-kit-support`(支持性引擎扩展)
|
||||
- `extension`(支持性引擎扩展)
|
||||
- `creator-sp.d.ts`(社区版类型文件)
|
||||
|
||||
## 替换自定义引擎
|
||||
@ -44,7 +44,7 @@ description: "需掌握一定的自定义引擎知识。"
|
||||
|
||||
## 安装支持性引擎扩展
|
||||
|
||||
按照官方的 [扩展安装](https://docs.cocos.com/creator/2.4/manual/zh/extension/install-and-share.html) 文档将压缩包内的 `enhance-kit-support` 目录放到项目的 `packages` 目录即可。
|
||||
按照官方的 [扩展安装](https://docs.cocos.com/creator/2.4/manual/zh/extension/install-and-share.html) 文档将压缩包内的 `extension` 目录放到项目的 `packages` 目录即可。
|
||||
|
||||
:::caution 注意
|
||||
|
||||
|
@ -42,4 +42,4 @@ sidebar_position: 6
|
||||
|
||||
点击 Cocos Creator 主界面右上角的 **编辑器** 按钮,进入到编辑器的资源目录。
|
||||
|
||||
然后使用未修改过的 `jsb-adapter` 替换掉编辑器的 `Resources/builtin/jsb-adapter` 目录,最后将增强包的引擎扩展(比如 `enhance-kit-support` 目录)删除。
|
||||
然后使用未修改过的 `jsb-adapter` 替换掉编辑器的 `Resources/builtin/jsb-adapter` 目录,最后将增强包的引擎扩展(比如 `extension` 目录)删除。
|
||||
|
@ -1,129 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-label", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.verticalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.actualFontSize"
|
||||
v-show="!_hiddenActualFontSize()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop type="number"
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target._bmFontOriginalSize"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.spacingX"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.overflow"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableWrapText"
|
||||
v-show="!_hiddenWrapText()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableBold"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableItalic"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableUnderline"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.underlineHeight"
|
||||
v-show="!_isBMFont() && target.enableUnderline.value === true"
|
||||
:indent="1"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop
|
||||
v-show="!_isCharCacheMode()"
|
||||
:target.sync="target.materials"
|
||||
></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isBMFont() {
|
||||
return this.target._bmFontOriginalSize.value > 0
|
||||
},
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_hiddenWrapText() {
|
||||
let t = this.target.overflow.value;
|
||||
return 0 === t || 3 === t
|
||||
},
|
||||
_hiddenActualFontSize() {
|
||||
return 2 !== this.target.overflow.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-richtext", {
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.maxWidth"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.imageAtlas"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.handleTouchEvent"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop v-show="!_isCharCacheMode()" v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,155 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-sprite", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Atlas"
|
||||
tooltip="{{T('COMPONENT.sprite.atlas')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-atlas"
|
||||
v-value="target._atlas.value.uuid"
|
||||
v-values="atlasUuids"
|
||||
:multi-values="atlasMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.select_tooltip')}}"
|
||||
@confirm="selectAtlas"
|
||||
>
|
||||
{{T('COMPONENT.sprite.select_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Sprite Frame"
|
||||
tooltip="{{T('COMPONENT.sprite.sprite_frame')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-frame"
|
||||
v-value="target.spriteFrame.value.uuid"
|
||||
v-values="spriteUuids"
|
||||
:multi-values="spriteMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.edit_tooltip')}}"
|
||||
@confirm="editSprite"
|
||||
>
|
||||
{{T('COMPONENT.sprite.edit_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.type"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<div v-if="isFilledType()">
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillType"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillCenter"
|
||||
v-disabled="!isRadialFilled()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillStart"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillRange"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
</div>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.sizeMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop v-if="allowTrim()"
|
||||
v-prop="target.trim"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop :target.sync="target.materials"></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data: ()=>({
|
||||
atlasUuid: "",
|
||||
atlasUuids: "",
|
||||
atlasMulti: !1,
|
||||
spriteUuid: "",
|
||||
spriteUuids: "",
|
||||
spriteMulti: !1
|
||||
}),
|
||||
created() {
|
||||
this.target && (this._updateAtlas(),
|
||||
this._updateSprite())
|
||||
},
|
||||
watch: {
|
||||
target() {
|
||||
this._updateAtlas(),
|
||||
this._updateSprite()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
selectAtlas() {
|
||||
Editor.Ipc.sendToPanel("assets", "change-filter", "t:sprite-atlas")
|
||||
},
|
||||
editSprite() {
|
||||
Editor.Panel.open("sprite-editor", {
|
||||
uuid: this.target.spriteFrame.value.uuid
|
||||
})
|
||||
},
|
||||
allowTrim() {
|
||||
return this.target.type.value === cc.Sprite.Type.SIMPLE
|
||||
},
|
||||
isFilledType() {
|
||||
return this.target.type.value === cc.Sprite.Type.FILLED
|
||||
},
|
||||
isRadialFilled() {
|
||||
return this.target.fillType.value === cc.Sprite.FillType.RADIAL
|
||||
},
|
||||
_updateAtlas() {
|
||||
if (!this.target)
|
||||
return this.atlasUuid = "",
|
||||
this.atlasUuids = "",
|
||||
this.atlasMulti = !1,
|
||||
void 0;
|
||||
this.atlasUuid = this.target._atlas.value.uuid,
|
||||
this.atlasUuids = this.target._atlas.values.map(t=>t.uuid);
|
||||
var t = this.atlasUuids[0];
|
||||
this.atlasMulti = !this.atlasUuids.every((i,e)=>0 === e || i === t)
|
||||
},
|
||||
_updateSprite() {
|
||||
if (!this.target)
|
||||
return this.spriteUuid = "",
|
||||
this.spriteUuids = "",
|
||||
this.spriteMulti = !1,
|
||||
void 0;
|
||||
this.spriteUuid = this.target.spriteFrame.value.uuid,
|
||||
this.spriteUuids = this.target.spriteFrame.values.map(t=>t.uuid);
|
||||
var t = this.spriteUuids[0];
|
||||
this.spriteMulti = !this.spriteUuids.every((i,e)=>0 === e || i === t)
|
||||
}
|
||||
}
|
||||
});
|
@ -1,3 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {};
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "enhance-kit",
|
||||
"version": "1.0.0",
|
||||
"description": "This extension provides support for cocos enhance kit.",
|
||||
"author": "SmallMain",
|
||||
"main": "main.js",
|
||||
"runtime-resource": {
|
||||
"path": "resources",
|
||||
"name": "resources"
|
||||
},
|
||||
"reload": {
|
||||
"ignore": [
|
||||
"resources/**/*"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "74663d94-6782-4dee-9db9-26127ee8b265",
|
||||
"isBundle": true,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "8ee63b7e-0ac8-4cb5-95f0-85278bfd748a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
texture2: { value: white }
|
||||
texture3: { value: white }
|
||||
texture4: { value: white }
|
||||
texture5: { value: white }
|
||||
texture6: { value: white }
|
||||
texture7: { value: white }
|
||||
texture8: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 a_color0;
|
||||
out vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float a_texId;
|
||||
out float v_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
v_texId = a_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
#if USE_TINT
|
||||
v_color0 = a_color0;
|
||||
#endif
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
#include <texture>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float v_texId;
|
||||
uniform sampler2D texture2;
|
||||
uniform sampler2D texture3;
|
||||
uniform sampler2D texture4;
|
||||
uniform sampler2D texture5;
|
||||
uniform sampler2D texture6;
|
||||
uniform sampler2D texture7;
|
||||
uniform sampler2D texture8;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 o = vec4(1, 1, 1, 1);
|
||||
|
||||
#if USE_TEXTURE
|
||||
#if USE_MULTI_TEXTURE
|
||||
if(v_texId < 1.0){
|
||||
CCTexture(texture, v_uv0, o);
|
||||
} else if(v_texId < 2.0){
|
||||
CCTexture(texture2, v_uv0, o);
|
||||
} else if(v_texId < 3.0){
|
||||
CCTexture(texture3, v_uv0, o);
|
||||
} else if(v_texId < 4.0){
|
||||
CCTexture(texture4, v_uv0, o);
|
||||
} else if(v_texId < 5.0){
|
||||
CCTexture(texture5, v_uv0, o);
|
||||
} else if(v_texId < 6.0){
|
||||
CCTexture(texture6, v_uv0, o);
|
||||
} else if(v_texId < 7.0){
|
||||
CCTexture(texture7, v_uv0, o);
|
||||
} else {
|
||||
CCTexture(texture8, v_uv0, o);
|
||||
}
|
||||
#else
|
||||
CCTexture(texture, v_uv0, o);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if USE_TINT
|
||||
vec4 finalColor;
|
||||
finalColor.a = v_color.a * o.a;
|
||||
finalColor.rgb = ((o.a - 1.0) * v_color0.a + 1.0 - o.rgb) * v_color0.rgb + o.rgb * v_color.rgb;
|
||||
|
||||
ALPHA_TEST(finalColor);
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
#else
|
||||
o *= v_color;
|
||||
|
||||
ALPHA_TEST(o);
|
||||
|
||||
gl_FragColor = o;
|
||||
#endif
|
||||
}
|
||||
}%
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "5dcffc18-b913-460e-a0d9-5d74f4cda12b",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nattribute float a_texId;\nvarying float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nvarying float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture2D(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture2D(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture2D(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture2D(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture2D(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture2D(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture2D(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture2D(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture2D(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture2D(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture2D(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture2D(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture2D(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture2D(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\nin float a_texId;\nout float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nin float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-label", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.verticalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.actualFontSize"
|
||||
v-show="!_hiddenActualFontSize()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop type="number"
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target._bmFontOriginalSize"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.spacingX"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.overflow"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableWrapText"
|
||||
v-show="!_hiddenWrapText()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableBold"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableItalic"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableUnderline"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.underlineHeight"
|
||||
v-show="!_isBMFont() && target.enableUnderline.value === true"
|
||||
:indent="1"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop
|
||||
v-show="!_isCharCacheMode()"
|
||||
:target.sync="target.materials"
|
||||
></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isBMFont() {
|
||||
return this.target._bmFontOriginalSize.value > 0
|
||||
},
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_hiddenWrapText() {
|
||||
let t = this.target.overflow.value;
|
||||
return 0 === t || 3 === t
|
||||
},
|
||||
_hiddenActualFontSize() {
|
||||
return 2 !== this.target.overflow.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-richtext", {
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.maxWidth"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.imageAtlas"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.handleTouchEvent"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop v-show="!_isCharCacheMode()" v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,155 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-sprite", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Atlas"
|
||||
tooltip="{{T('COMPONENT.sprite.atlas')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-atlas"
|
||||
v-value="target._atlas.value.uuid"
|
||||
v-values="atlasUuids"
|
||||
:multi-values="atlasMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.select_tooltip')}}"
|
||||
@confirm="selectAtlas"
|
||||
>
|
||||
{{T('COMPONENT.sprite.select_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Sprite Frame"
|
||||
tooltip="{{T('COMPONENT.sprite.sprite_frame')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-frame"
|
||||
v-value="target.spriteFrame.value.uuid"
|
||||
v-values="spriteUuids"
|
||||
:multi-values="spriteMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.edit_tooltip')}}"
|
||||
@confirm="editSprite"
|
||||
>
|
||||
{{T('COMPONENT.sprite.edit_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.type"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<div v-if="isFilledType()">
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillType"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillCenter"
|
||||
v-disabled="!isRadialFilled()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillStart"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillRange"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
</div>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.sizeMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop v-if="allowTrim()"
|
||||
v-prop="target.trim"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop :target.sync="target.materials"></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data: ()=>({
|
||||
atlasUuid: "",
|
||||
atlasUuids: "",
|
||||
atlasMulti: !1,
|
||||
spriteUuid: "",
|
||||
spriteUuids: "",
|
||||
spriteMulti: !1
|
||||
}),
|
||||
created() {
|
||||
this.target && (this._updateAtlas(),
|
||||
this._updateSprite())
|
||||
},
|
||||
watch: {
|
||||
target() {
|
||||
this._updateAtlas(),
|
||||
this._updateSprite()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
selectAtlas() {
|
||||
Editor.Ipc.sendToPanel("assets", "change-filter", "t:sprite-atlas")
|
||||
},
|
||||
editSprite() {
|
||||
Editor.Panel.open("sprite-editor", {
|
||||
uuid: this.target.spriteFrame.value.uuid
|
||||
})
|
||||
},
|
||||
allowTrim() {
|
||||
return this.target.type.value === cc.Sprite.Type.SIMPLE
|
||||
},
|
||||
isFilledType() {
|
||||
return this.target.type.value === cc.Sprite.Type.FILLED
|
||||
},
|
||||
isRadialFilled() {
|
||||
return this.target.fillType.value === cc.Sprite.FillType.RADIAL
|
||||
},
|
||||
_updateAtlas() {
|
||||
if (!this.target)
|
||||
return this.atlasUuid = "",
|
||||
this.atlasUuids = "",
|
||||
this.atlasMulti = !1,
|
||||
void 0;
|
||||
this.atlasUuid = this.target._atlas.value.uuid,
|
||||
this.atlasUuids = this.target._atlas.values.map(t=>t.uuid);
|
||||
var t = this.atlasUuids[0];
|
||||
this.atlasMulti = !this.atlasUuids.every((i,e)=>0 === e || i === t)
|
||||
},
|
||||
_updateSprite() {
|
||||
if (!this.target)
|
||||
return this.spriteUuid = "",
|
||||
this.spriteUuids = "",
|
||||
this.spriteMulti = !1,
|
||||
void 0;
|
||||
this.spriteUuid = this.target.spriteFrame.value.uuid,
|
||||
this.spriteUuids = this.target.spriteFrame.values.map(t=>t.uuid);
|
||||
var t = this.spriteUuids[0];
|
||||
this.spriteMulti = !this.spriteUuids.every((i,e)=>0 === e || i === t)
|
||||
}
|
||||
}
|
||||
});
|
@ -1,3 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {};
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "enhance-kit",
|
||||
"version": "1.1.0",
|
||||
"description": "This extension provides support for cocos enhance kit.",
|
||||
"author": "SmallMain",
|
||||
"main": "main.js",
|
||||
"runtime-resource": {
|
||||
"path": "resources",
|
||||
"name": "resources"
|
||||
},
|
||||
"reload": {
|
||||
"ignore": [
|
||||
"resources/**/*"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "74663d94-6782-4dee-9db9-26127ee8b265",
|
||||
"isBundle": true,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "8ee63b7e-0ac8-4cb5-95f0-85278bfd748a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
texture2: { value: white }
|
||||
texture3: { value: white }
|
||||
texture4: { value: white }
|
||||
texture5: { value: white }
|
||||
texture6: { value: white }
|
||||
texture7: { value: white }
|
||||
texture8: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 a_color0;
|
||||
out vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float a_texId;
|
||||
out float v_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
v_texId = a_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
#if USE_TINT
|
||||
v_color0 = a_color0;
|
||||
#endif
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
#include <texture>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float v_texId;
|
||||
uniform sampler2D texture2;
|
||||
uniform sampler2D texture3;
|
||||
uniform sampler2D texture4;
|
||||
uniform sampler2D texture5;
|
||||
uniform sampler2D texture6;
|
||||
uniform sampler2D texture7;
|
||||
uniform sampler2D texture8;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 o = vec4(1, 1, 1, 1);
|
||||
|
||||
#if USE_TEXTURE
|
||||
#if USE_MULTI_TEXTURE
|
||||
if(v_texId < 1.0){
|
||||
CCTexture(texture, v_uv0, o);
|
||||
} else if(v_texId < 2.0){
|
||||
CCTexture(texture2, v_uv0, o);
|
||||
} else if(v_texId < 3.0){
|
||||
CCTexture(texture3, v_uv0, o);
|
||||
} else if(v_texId < 4.0){
|
||||
CCTexture(texture4, v_uv0, o);
|
||||
} else if(v_texId < 5.0){
|
||||
CCTexture(texture5, v_uv0, o);
|
||||
} else if(v_texId < 6.0){
|
||||
CCTexture(texture6, v_uv0, o);
|
||||
} else if(v_texId < 7.0){
|
||||
CCTexture(texture7, v_uv0, o);
|
||||
} else {
|
||||
CCTexture(texture8, v_uv0, o);
|
||||
}
|
||||
#else
|
||||
CCTexture(texture, v_uv0, o);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if USE_TINT
|
||||
vec4 finalColor;
|
||||
finalColor.a = v_color.a * o.a;
|
||||
finalColor.rgb = ((o.a - 1.0) * v_color0.a + 1.0 - o.rgb) * v_color0.rgb + o.rgb * v_color.rgb;
|
||||
|
||||
ALPHA_TEST(finalColor);
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
#else
|
||||
o *= v_color;
|
||||
|
||||
ALPHA_TEST(o);
|
||||
|
||||
gl_FragColor = o;
|
||||
#endif
|
||||
}
|
||||
}%
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "5dcffc18-b913-460e-a0d9-5d74f4cda12b",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nattribute float a_texId;\nvarying float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nvarying float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture2D(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture2D(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture2D(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture2D(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture2D(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture2D(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture2D(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture2D(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture2D(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture2D(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture2D(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture2D(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture2D(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture2D(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\nin float a_texId;\nout float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nin float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-label", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.verticalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.actualFontSize"
|
||||
v-show="!_hiddenActualFontSize()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop type="number"
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target._bmFontOriginalSize"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.spacingX"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.overflow"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableWrapText"
|
||||
v-show="!_hiddenWrapText()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableBold"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableItalic"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableUnderline"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.underlineHeight"
|
||||
v-show="!_isBMFont() && target.enableUnderline.value === true"
|
||||
:indent="1"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop
|
||||
v-show="!_isCharCacheMode()"
|
||||
:target.sync="target.materials"
|
||||
></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isBMFont() {
|
||||
return this.target._bmFontOriginalSize.value > 0
|
||||
},
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_hiddenWrapText() {
|
||||
let t = this.target.overflow.value;
|
||||
return 0 === t || 3 === t
|
||||
},
|
||||
_hiddenActualFontSize() {
|
||||
return 2 !== this.target.overflow.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-richtext", {
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.maxWidth"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.imageAtlas"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.handleTouchEvent"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop v-show="!_isCharCacheMode()" v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,155 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-sprite", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Atlas"
|
||||
tooltip="{{T('COMPONENT.sprite.atlas')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-atlas"
|
||||
v-value="target._atlas.value.uuid"
|
||||
v-values="atlasUuids"
|
||||
:multi-values="atlasMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.select_tooltip')}}"
|
||||
@confirm="selectAtlas"
|
||||
>
|
||||
{{T('COMPONENT.sprite.select_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Sprite Frame"
|
||||
tooltip="{{T('COMPONENT.sprite.sprite_frame')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-frame"
|
||||
v-value="target.spriteFrame.value.uuid"
|
||||
v-values="spriteUuids"
|
||||
:multi-values="spriteMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.edit_tooltip')}}"
|
||||
@confirm="editSprite"
|
||||
>
|
||||
{{T('COMPONENT.sprite.edit_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.type"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<div v-if="isFilledType()">
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillType"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillCenter"
|
||||
v-disabled="!isRadialFilled()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillStart"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillRange"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
</div>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.sizeMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop v-if="allowTrim()"
|
||||
v-prop="target.trim"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop :target.sync="target.materials"></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data: ()=>({
|
||||
atlasUuid: "",
|
||||
atlasUuids: "",
|
||||
atlasMulti: !1,
|
||||
spriteUuid: "",
|
||||
spriteUuids: "",
|
||||
spriteMulti: !1
|
||||
}),
|
||||
created() {
|
||||
this.target && (this._updateAtlas(),
|
||||
this._updateSprite())
|
||||
},
|
||||
watch: {
|
||||
target() {
|
||||
this._updateAtlas(),
|
||||
this._updateSprite()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
selectAtlas() {
|
||||
Editor.Ipc.sendToPanel("assets", "change-filter", "t:sprite-atlas")
|
||||
},
|
||||
editSprite() {
|
||||
Editor.Panel.open("sprite-editor", {
|
||||
uuid: this.target.spriteFrame.value.uuid
|
||||
})
|
||||
},
|
||||
allowTrim() {
|
||||
return this.target.type.value === cc.Sprite.Type.SIMPLE
|
||||
},
|
||||
isFilledType() {
|
||||
return this.target.type.value === cc.Sprite.Type.FILLED
|
||||
},
|
||||
isRadialFilled() {
|
||||
return this.target.fillType.value === cc.Sprite.FillType.RADIAL
|
||||
},
|
||||
_updateAtlas() {
|
||||
if (!this.target)
|
||||
return this.atlasUuid = "",
|
||||
this.atlasUuids = "",
|
||||
this.atlasMulti = !1,
|
||||
void 0;
|
||||
this.atlasUuid = this.target._atlas.value.uuid,
|
||||
this.atlasUuids = this.target._atlas.values.map(t=>t.uuid);
|
||||
var t = this.atlasUuids[0];
|
||||
this.atlasMulti = !this.atlasUuids.every((i,e)=>0 === e || i === t)
|
||||
},
|
||||
_updateSprite() {
|
||||
if (!this.target)
|
||||
return this.spriteUuid = "",
|
||||
this.spriteUuids = "",
|
||||
this.spriteMulti = !1,
|
||||
void 0;
|
||||
this.spriteUuid = this.target.spriteFrame.value.uuid,
|
||||
this.spriteUuids = this.target.spriteFrame.values.map(t=>t.uuid);
|
||||
var t = this.spriteUuids[0];
|
||||
this.spriteMulti = !this.spriteUuids.every((i,e)=>0 === e || i === t)
|
||||
}
|
||||
}
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-tiled-layer", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: '\n <ui-prop\n v-prop="target.cullingLayer"\n :multi-values="multi"\n ></ui-prop> <cc-array-prop :target.sync="target.materials"></cc-array-prop>\n\n ',
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
}
|
||||
});
|
@ -1,3 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {};
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "enhance-kit",
|
||||
"version": "1.2.0",
|
||||
"description": "This extension provides support for cocos enhance kit.",
|
||||
"author": "SmallMain",
|
||||
"main": "main.js",
|
||||
"runtime-resource": {
|
||||
"path": "resources",
|
||||
"name": "resources"
|
||||
},
|
||||
"reload": {
|
||||
"ignore": [
|
||||
"resources/**/*"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "74663d94-6782-4dee-9db9-26127ee8b265",
|
||||
"isBundle": true,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "8ee63b7e-0ac8-4cb5-95f0-85278bfd748a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
texture2: { value: white }
|
||||
texture3: { value: white }
|
||||
texture4: { value: white }
|
||||
texture5: { value: white }
|
||||
texture6: { value: white }
|
||||
texture7: { value: white }
|
||||
texture8: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 a_color0;
|
||||
out vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float a_texId;
|
||||
out float v_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
v_texId = a_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
#if USE_TINT
|
||||
v_color0 = a_color0;
|
||||
#endif
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
#include <texture>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float v_texId;
|
||||
uniform sampler2D texture2;
|
||||
uniform sampler2D texture3;
|
||||
uniform sampler2D texture4;
|
||||
uniform sampler2D texture5;
|
||||
uniform sampler2D texture6;
|
||||
uniform sampler2D texture7;
|
||||
uniform sampler2D texture8;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 o = vec4(1, 1, 1, 1);
|
||||
|
||||
#if USE_TEXTURE
|
||||
#if USE_MULTI_TEXTURE
|
||||
if(v_texId < 1.0){
|
||||
CCTexture(texture, v_uv0, o);
|
||||
} else if(v_texId < 2.0){
|
||||
CCTexture(texture2, v_uv0, o);
|
||||
} else if(v_texId < 3.0){
|
||||
CCTexture(texture3, v_uv0, o);
|
||||
} else if(v_texId < 4.0){
|
||||
CCTexture(texture4, v_uv0, o);
|
||||
} else if(v_texId < 5.0){
|
||||
CCTexture(texture5, v_uv0, o);
|
||||
} else if(v_texId < 6.0){
|
||||
CCTexture(texture6, v_uv0, o);
|
||||
} else if(v_texId < 7.0){
|
||||
CCTexture(texture7, v_uv0, o);
|
||||
} else {
|
||||
CCTexture(texture8, v_uv0, o);
|
||||
}
|
||||
#else
|
||||
CCTexture(texture, v_uv0, o);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if USE_TINT
|
||||
vec4 finalColor;
|
||||
finalColor.a = v_color.a * o.a;
|
||||
finalColor.rgb = ((o.a - 1.0) * v_color0.a + 1.0 - o.rgb) * v_color0.rgb + o.rgb * v_color.rgb;
|
||||
|
||||
ALPHA_TEST(finalColor);
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
#else
|
||||
o *= v_color;
|
||||
|
||||
ALPHA_TEST(o);
|
||||
|
||||
gl_FragColor = o;
|
||||
#endif
|
||||
}
|
||||
}%
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "5dcffc18-b913-460e-a0d9-5d74f4cda12b",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nattribute float a_texId;\nvarying float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nvarying float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture2D(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture2D(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture2D(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture2D(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture2D(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture2D(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture2D(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture2D(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture2D(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture2D(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture2D(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture2D(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture2D(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture2D(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\nin float a_texId;\nout float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nin float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
module.exports = {
|
||||
'settingsmenuname': 'Enhance Kit Settings...',
|
||||
'settings_title': 'Enhance Kit Settings',
|
||||
};
|
@ -1,4 +0,0 @@
|
||||
module.exports = {
|
||||
'settingsmenuname': '增强包设置...',
|
||||
'settings_title': '增强包设置',
|
||||
};
|
@ -1,129 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-label", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.verticalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.actualFontSize"
|
||||
v-show="!_hiddenActualFontSize()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop type="number"
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target._bmFontOriginalSize"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.spacingX"
|
||||
v-show="_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.overflow"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableWrapText"
|
||||
v-show="!_hiddenWrapText()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableBold"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableItalic"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.enableUnderline"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.underlineHeight"
|
||||
v-show="!_isBMFont() && target.enableUnderline.value === true"
|
||||
:indent="1"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
v-show="!_isBMFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop
|
||||
v-show="!_isCharCacheMode()"
|
||||
:target.sync="target.materials"
|
||||
></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isBMFont() {
|
||||
return this.target._bmFontOriginalSize.value > 0
|
||||
},
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_hiddenWrapText() {
|
||||
let t = this.target.overflow.value;
|
||||
return 0 === t || 3 === t
|
||||
},
|
||||
_hiddenActualFontSize() {
|
||||
return 2 !== this.target.overflow.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-richtext", {
|
||||
template: `
|
||||
<ui-prop
|
||||
v-prop="target.string"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.horizontalAlign"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontSize">
|
||||
:multi-values="multi"
|
||||
</ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.font"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.fontFamily"
|
||||
v-show="_isSystemFont()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.useSystemFont"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.cacheMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.maxWidth"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.lineHeight"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.imageAtlas"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop
|
||||
v-prop="target.handleTouchEvent"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop v-show="!_isCharCacheMode()" v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
@ -1,155 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-sprite", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: `
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Atlas"
|
||||
tooltip="{{T('COMPONENT.sprite.atlas')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-atlas"
|
||||
v-value="target._atlas.value.uuid"
|
||||
v-values="atlasUuids"
|
||||
:multi-values="atlasMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.select_tooltip')}}"
|
||||
@confirm="selectAtlas"
|
||||
>
|
||||
{{T('COMPONENT.sprite.select_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
style="padding-top: 8px"
|
||||
name="Sprite Frame"
|
||||
tooltip="{{T('COMPONENT.sprite.sprite_frame')}}"
|
||||
>
|
||||
<ui-asset class="flex-1"
|
||||
type="sprite-frame"
|
||||
v-value="target.spriteFrame.value.uuid"
|
||||
v-values="spriteUuids"
|
||||
:multi-values="spriteMulti"
|
||||
></ui-asset>
|
||||
<ui-button
|
||||
class="blue tiny"
|
||||
tooltip="{{T('COMPONENT.sprite.edit_tooltip')}}"
|
||||
@confirm="editSprite"
|
||||
>
|
||||
{{T('COMPONENT.sprite.edit_button')}}
|
||||
</ui-button>
|
||||
</ui-prop>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.type"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<div v-if="isFilledType()">
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillType"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillCenter"
|
||||
v-disabled="!isRadialFilled()"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillStart"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop indent=1
|
||||
v-prop="target.fillRange"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
</div>
|
||||
|
||||
<ui-prop
|
||||
v-prop="target.sizeMode"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
<ui-prop v-if="allowTrim()"
|
||||
v-prop="target.trim"
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<cc-blend-section :target.sync="target"></cc-blend-section>
|
||||
<cc-array-prop :target.sync="target.materials"></cc-array-prop>
|
||||
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
`,
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data: ()=>({
|
||||
atlasUuid: "",
|
||||
atlasUuids: "",
|
||||
atlasMulti: !1,
|
||||
spriteUuid: "",
|
||||
spriteUuids: "",
|
||||
spriteMulti: !1
|
||||
}),
|
||||
created() {
|
||||
this.target && (this._updateAtlas(),
|
||||
this._updateSprite())
|
||||
},
|
||||
watch: {
|
||||
target() {
|
||||
this._updateAtlas(),
|
||||
this._updateSprite()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
T: Editor.T,
|
||||
selectAtlas() {
|
||||
Editor.Ipc.sendToPanel("assets", "change-filter", "t:sprite-atlas")
|
||||
},
|
||||
editSprite() {
|
||||
Editor.Panel.open("sprite-editor", {
|
||||
uuid: this.target.spriteFrame.value.uuid
|
||||
})
|
||||
},
|
||||
allowTrim() {
|
||||
return this.target.type.value === cc.Sprite.Type.SIMPLE
|
||||
},
|
||||
isFilledType() {
|
||||
return this.target.type.value === cc.Sprite.Type.FILLED
|
||||
},
|
||||
isRadialFilled() {
|
||||
return this.target.fillType.value === cc.Sprite.FillType.RADIAL
|
||||
},
|
||||
_updateAtlas() {
|
||||
if (!this.target)
|
||||
return this.atlasUuid = "",
|
||||
this.atlasUuids = "",
|
||||
this.atlasMulti = !1,
|
||||
void 0;
|
||||
this.atlasUuid = this.target._atlas.value.uuid,
|
||||
this.atlasUuids = this.target._atlas.values.map(t=>t.uuid);
|
||||
var t = this.atlasUuids[0];
|
||||
this.atlasMulti = !this.atlasUuids.every((i,e)=>0 === e || i === t)
|
||||
},
|
||||
_updateSprite() {
|
||||
if (!this.target)
|
||||
return this.spriteUuid = "",
|
||||
this.spriteUuids = "",
|
||||
this.spriteMulti = !1,
|
||||
void 0;
|
||||
this.spriteUuid = this.target.spriteFrame.value.uuid,
|
||||
this.spriteUuids = this.target.spriteFrame.values.map(t=>t.uuid);
|
||||
var t = this.spriteUuids[0];
|
||||
this.spriteMulti = !this.spriteUuids.every((i,e)=>0 === e || i === t)
|
||||
}
|
||||
}
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Vue.component("cc-tiled-layer", {
|
||||
dependencies: ["packages://inspector/share/blend.js"],
|
||||
template: '\n <ui-prop\n v-prop="target.cullingLayer"\n :multi-values="multi"\n ></ui-prop> <cc-array-prop :target.sync="target.materials"></cc-array-prop>\n\n ',
|
||||
props: {
|
||||
target: {
|
||||
twoWay: !0,
|
||||
type: Object
|
||||
},
|
||||
multi: {
|
||||
twoWay: !0,
|
||||
type: Boolean
|
||||
}
|
||||
}
|
||||
});
|
@ -1,136 +0,0 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* 环境信息
|
||||
*/
|
||||
let engineEditorPath = path.dirname(path.dirname(Editor.frameworkPath));
|
||||
|
||||
const engineMinigameAdapterPath = path.join(engineEditorPath, "builtin", "adapters");
|
||||
const engineWechatMinigameWorkerMainMacroPath = path.join(engineEditorPath, "builtin", "adapters", "platforms/wechat/worker/macro.js");
|
||||
const engineWechatMinigameWorkerSubMacroPath = path.join(engineEditorPath, "builtin", "adapters", "platforms/wechat/res/workers/macro.js");
|
||||
|
||||
const WECHAT_MINIGAME_WORKER_SUB_PATH = "platforms/wechat/res/workers";
|
||||
const WECHAT_MINIGAME_CONFIG_PATH = "platforms/wechat/res/game.json";
|
||||
|
||||
function t(str) {
|
||||
return Editor.T('enhance-kit.' + str);
|
||||
}
|
||||
|
||||
function getMinigameAdapterVersion() {
|
||||
try {
|
||||
return fs.readFileSync(path.join(engineMinigameAdapterPath, "VERSION.md"), { encoding: "utf-8" }).trim();
|
||||
} catch (error) {
|
||||
// Editor.error(error);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function getSettings() {
|
||||
const minigameVersion = getMinigameAdapterVersion();
|
||||
const isUninstalled = minigameVersion === "";
|
||||
const isSupported = !isUninstalled && Number(minigameVersion.split(".")[0]) >= 2;
|
||||
if (isUninstalled) {
|
||||
return { code: -1, errMsg: "请先安装增强包。" };
|
||||
} else if (!isSupported) {
|
||||
return { code: -2, errMsg: "需安装版本 >= 2.0.0 的增强包,以支持设置面板功能。" };
|
||||
} else {
|
||||
const content = fs.readFileSync(engineWechatMinigameWorkerMainMacroPath, { encoding: "utf-8" });
|
||||
|
||||
return {
|
||||
code: 0,
|
||||
CC_WORKER_DEBUG: getMacroBooleanValue(content, "CC_WORKER_DEBUG"),
|
||||
CC_WORKER_ASSET_PIPELINE: getMacroBooleanValue(content, "CC_WORKER_ASSET_PIPELINE"),
|
||||
CC_WORKER_AUDIO_SYSTEM: getMacroBooleanValue(content, "CC_WORKER_AUDIO_SYSTEM"),
|
||||
CC_WORKER_SCHEDULER: getMacroBooleanValue(content, "CC_WORKER_SCHEDULER"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function syncSettingsToSubWorker() {
|
||||
const result = getSettings();
|
||||
if (result.code === 0) {
|
||||
let content = fs.readFileSync(engineWechatMinigameWorkerSubMacroPath, { encoding: "utf-8" });
|
||||
|
||||
for (const key in result) {
|
||||
if (key !== "code") {
|
||||
content = setMacroBooleanValue(content, key, result[key]);
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(engineWechatMinigameWorkerSubMacroPath, content);
|
||||
}
|
||||
}
|
||||
|
||||
function setSettings(macro, value) {
|
||||
{
|
||||
const content = fs.readFileSync(engineWechatMinigameWorkerMainMacroPath, { encoding: "utf-8" });
|
||||
fs.writeFileSync(engineWechatMinigameWorkerMainMacroPath, setMacroBooleanValue(content, macro, value));
|
||||
}
|
||||
|
||||
checkAndModifyWorkerFiles();
|
||||
syncSettingsToSubWorker();
|
||||
}
|
||||
|
||||
function getMacroBooleanValue(text, macro) {
|
||||
const regex = new RegExp(`globalThis\\.${macro}\\s*=\\s*(true|false);`);
|
||||
const match = text.match(regex);
|
||||
return match ? match[1] === 'true' : null;
|
||||
}
|
||||
|
||||
function setMacroBooleanValue(text, macro, value) {
|
||||
const regex = new RegExp(`globalThis\\.${macro}\\s*=\\s*(true|false);`);
|
||||
const replacement = `globalThis.${macro} = ${value};`;
|
||||
return text.replace(regex, replacement);
|
||||
}
|
||||
|
||||
function checkAndModifyWorkerFiles() {
|
||||
const result = getSettings();
|
||||
if (result.code === 0) {
|
||||
const workerDir = path.join(engineMinigameAdapterPath, WECHAT_MINIGAME_WORKER_SUB_PATH);
|
||||
const gameJsonPath = path.join(engineMinigameAdapterPath, WECHAT_MINIGAME_CONFIG_PATH);
|
||||
const gameJson = JSON.parse(fs.readFileSync(gameJsonPath, { encoding: "utf-8" }));
|
||||
|
||||
// 是否启用 Worker
|
||||
if (result.CC_WORKER_ASSET_PIPELINE || result.CC_WORKER_AUDIO_SYSTEM) {
|
||||
// 没有 Worker 目录与配置的话提醒用户重新安装
|
||||
if (!(gameJson.workers && fs.existsSync(workerDir))) {
|
||||
Editor.error("你启用了增强包的多线程特性,但未检测到正确的 workers 目录与 game.json 字段,请重新安装增强包,详情请查看文档:TODO");
|
||||
}
|
||||
} else {
|
||||
Editor.warn("你禁用了增强包的多线程特性,可以手动删除相关文件以减少包体大小,详情请查看文档:TODO");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
async load() {
|
||||
// 这里场景未准备就绪,无法获取 engineVersion
|
||||
},
|
||||
|
||||
messages: {
|
||||
|
||||
openSettings() {
|
||||
Editor.Panel.open('enhance-kit');
|
||||
},
|
||||
|
||||
getSettings(event) {
|
||||
const result = getSettings();
|
||||
event.reply(null, result);
|
||||
},
|
||||
|
||||
setSettings(event, macro, value) {
|
||||
setSettings(macro, value);
|
||||
event.reply(null);
|
||||
},
|
||||
|
||||
"scene:ready"(event) {
|
||||
checkAndModifyWorkerFiles();
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "enhance-kit",
|
||||
"version": "2.0.0",
|
||||
"description": "This extension provides support for cocos enhance kit.",
|
||||
"author": "SmallMain",
|
||||
"main": "main.js",
|
||||
"panel": {
|
||||
"main": "panel/index.js",
|
||||
"type": "dockable",
|
||||
"title": "i18n:enhance-kit.settings_title",
|
||||
"width": 500,
|
||||
"height": 600,
|
||||
"min-width": 500,
|
||||
"min-height": 600
|
||||
},
|
||||
"main-menu": {
|
||||
"i18n:MAIN_MENU.project.title/i18n:enhance-kit.settingsmenuname": {
|
||||
"message": "enhance-kit:openSettings"
|
||||
}
|
||||
},
|
||||
"runtime-resource": {
|
||||
"path": "resources",
|
||||
"name": "resources"
|
||||
},
|
||||
"reload": {
|
||||
"ignore": [
|
||||
"resources/**/*"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
Editor.Panel.extend({
|
||||
style: `
|
||||
:host { margin: 5px; }
|
||||
h1 { margin-left: 15px; }
|
||||
.desc { color: gray; margin-left: 15px; margin-right: 15px; }
|
||||
.subdesc { color: gray; }
|
||||
.sub { margin-left: 30px; margin-right: 30px; }
|
||||
.hidden { display: none; }
|
||||
`,
|
||||
|
||||
template: `
|
||||
<div id="unripe">
|
||||
<p id="unripe_tip" class="desc">加载中...</p>
|
||||
</div>
|
||||
<div id="ready" class="hidden">
|
||||
<h1>多线程支持</h1>
|
||||
<p class="desc">该特性仅在微信小游戏平台下有效。</p>
|
||||
<hr />
|
||||
<div class="sub">
|
||||
<p class="subdesc">请注意,以下为全局设置,会影响所有项目,并在重新安装升级或卸载后丢失所有设置。</p>
|
||||
<ui-prop id="td" tabindex="-1" name="调试模式" tooltip="启用后将会输出详细日志以便进行调试,这可能会大幅降低性能。">
|
||||
<ui-checkbox id="tdc" tabindex="-1"></ui-checkbox>
|
||||
</ui-prop>
|
||||
<ui-prop id="tap" tabindex="-1" name="多线程驱动资源管线" tooltip="启用后将资源管线移至线程中执行,减少由资源下载、缓存与加载导致的卡顿。">
|
||||
<ui-checkbox id="tapc" tabindex="-1"></ui-checkbox>
|
||||
</ui-prop>
|
||||
<ui-prop id="fs" tabindex="-1" name="多线程驱动音频系统" tooltip="启用后将音频耗时操作移至线程中执行,减少由音频 API 调用导致的卡顿。">
|
||||
<ui-checkbox id="fsc" tabindex="-1"></ui-checkbox>
|
||||
</ui-prop>
|
||||
<ui-prop id="ts" tabindex="-1" name="线程通信调度器" tooltip="启用后将会对多次数据通信打包发送,这可能会减少因通信次数带来的性能消耗。">
|
||||
<ui-checkbox id="tsc" tabindex="-1"></ui-checkbox>
|
||||
</ui-prop>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
|
||||
$: {
|
||||
unripe_area: '#unripe',
|
||||
unripe_tip: '#unripe_tip',
|
||||
ready_area: '#ready',
|
||||
thread_debug: '#td',
|
||||
thread_debug_checkbox: '#tdc',
|
||||
thread_asset_pipeline: '#tap',
|
||||
thread_asset_pipeline_checkbox: '#tapc',
|
||||
thread_audio_system: '#fs',
|
||||
thread_audio_system_checkbox: '#fsc',
|
||||
thread_scheduler: '#ts',
|
||||
thread_scheduler_checkbox: '#tsc',
|
||||
},
|
||||
|
||||
ready() {
|
||||
Editor.Ipc.sendToMain('enhance-kit:getSettings', (error, data) => {
|
||||
if (error) {
|
||||
this.$unripe_tip.textContent = '发生错误:' + String(error);
|
||||
this.$unripe_tip.style.color = 'red';
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.code === 0) {
|
||||
this.$unripe_area.classList.add('hidden');
|
||||
this.$ready_area.classList.remove('hidden');
|
||||
|
||||
this.$thread_debug_checkbox.checked = data.CC_WORKER_DEBUG;
|
||||
this.$thread_asset_pipeline_checkbox.checked = data.CC_WORKER_ASSET_PIPELINE;
|
||||
this.$thread_audio_system_checkbox.checked = data.CC_WORKER_AUDIO_SYSTEM;
|
||||
this.$thread_scheduler_checkbox.checked = data.CC_WORKER_SCHEDULER;
|
||||
|
||||
this.$thread_debug_checkbox.addEventListener('change', () => {
|
||||
this.setSettings("CC_WORKER_DEBUG", this.$thread_debug_checkbox.checked);
|
||||
});
|
||||
|
||||
this.$thread_asset_pipeline_checkbox.addEventListener('change', () => {
|
||||
this.setSettings("CC_WORKER_ASSET_PIPELINE", this.$thread_asset_pipeline_checkbox.checked);
|
||||
});
|
||||
|
||||
this.$thread_audio_system_checkbox.addEventListener('change', () => {
|
||||
this.setSettings("CC_WORKER_AUDIO_SYSTEM", this.$thread_audio_system_checkbox.checked);
|
||||
});
|
||||
|
||||
this.$thread_scheduler_checkbox.addEventListener('change', () => {
|
||||
this.setSettings("CC_WORKER_SCHEDULER", this.$thread_scheduler_checkbox.checked);
|
||||
});
|
||||
} else {
|
||||
this.$unripe_tip.textContent = data.errMsg;
|
||||
this.$unripe_tip.style.color = 'red';
|
||||
}
|
||||
}, 5000);
|
||||
},
|
||||
|
||||
async setSettings(macro, value) {
|
||||
return new Promise((resolve, reject) => {
|
||||
Editor.Ipc.sendToMain('enhance-kit:setSettings', macro, value, (error) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}, 3000);
|
||||
});
|
||||
},
|
||||
});
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "74663d94-6782-4dee-9db9-26127ee8b265",
|
||||
"isBundle": true,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "8ee63b7e-0ac8-4cb5-95f0-85278bfd748a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
texture2: { value: white }
|
||||
texture3: { value: white }
|
||||
texture4: { value: white }
|
||||
texture5: { value: white }
|
||||
texture6: { value: white }
|
||||
texture7: { value: white }
|
||||
texture8: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 a_color0;
|
||||
out vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float a_texId;
|
||||
out float v_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
v_texId = a_texId;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
#if USE_TINT
|
||||
v_color0 = a_color0;
|
||||
#endif
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
#include <texture>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TINT
|
||||
in vec4 v_color0;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
|
||||
#if USE_MULTI_TEXTURE
|
||||
in float v_texId;
|
||||
uniform sampler2D texture2;
|
||||
uniform sampler2D texture3;
|
||||
uniform sampler2D texture4;
|
||||
uniform sampler2D texture5;
|
||||
uniform sampler2D texture6;
|
||||
uniform sampler2D texture7;
|
||||
uniform sampler2D texture8;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 o = vec4(1, 1, 1, 1);
|
||||
|
||||
#if USE_TEXTURE
|
||||
#if USE_MULTI_TEXTURE
|
||||
if(v_texId < 1.0){
|
||||
CCTexture(texture, v_uv0, o);
|
||||
} else if(v_texId < 2.0){
|
||||
CCTexture(texture2, v_uv0, o);
|
||||
} else if(v_texId < 3.0){
|
||||
CCTexture(texture3, v_uv0, o);
|
||||
} else if(v_texId < 4.0){
|
||||
CCTexture(texture4, v_uv0, o);
|
||||
} else if(v_texId < 5.0){
|
||||
CCTexture(texture5, v_uv0, o);
|
||||
} else if(v_texId < 6.0){
|
||||
CCTexture(texture6, v_uv0, o);
|
||||
} else if(v_texId < 7.0){
|
||||
CCTexture(texture7, v_uv0, o);
|
||||
} else {
|
||||
CCTexture(texture8, v_uv0, o);
|
||||
}
|
||||
#else
|
||||
CCTexture(texture, v_uv0, o);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if USE_TINT
|
||||
vec4 finalColor;
|
||||
finalColor.a = v_color.a * o.a;
|
||||
finalColor.rgb = ((o.a - 1.0) * v_color0.a + 1.0 - o.rgb) * v_color0.rgb + o.rgb * v_color.rgb;
|
||||
|
||||
ALPHA_TEST(finalColor);
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
#else
|
||||
o *= v_color;
|
||||
|
||||
ALPHA_TEST(o);
|
||||
|
||||
gl_FragColor = o;
|
||||
#endif
|
||||
}
|
||||
}%
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "5dcffc18-b913-460e-a0d9-5d74f4cda12b",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nattribute float a_texId;\nvarying float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nvarying float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture2D(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture2D(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture2D(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture2D(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture2D(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture2D(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture2D(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture2D(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture2D(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture2D(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture2D(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture2D(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture2D(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture2D(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\nin float a_texId;\nout float v_texId;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n v_texId = a_texId;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nin float v_texId;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n if(v_texId < 1.0){\n vec4 texture_tmp = texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n } else if(v_texId < 2.0){\n vec4 texture2_tmp = texture(texture2, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture2\n texture2_tmp.a *= texture(texture2, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n o.a *= texture2_tmp.a;\n #else\n o *= texture2_tmp;\n #endif\n } else if(v_texId < 3.0){\n vec4 texture3_tmp = texture(texture3, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture3\n texture3_tmp.a *= texture(texture3, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n o.a *= texture3_tmp.a;\n #else\n o *= texture3_tmp;\n #endif\n } else if(v_texId < 4.0){\n vec4 texture4_tmp = texture(texture4, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture4\n texture4_tmp.a *= texture(texture4, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n o.a *= texture4_tmp.a;\n #else\n o *= texture4_tmp;\n #endif\n } else if(v_texId < 5.0){\n vec4 texture5_tmp = texture(texture5, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture5\n texture5_tmp.a *= texture(texture5, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n o.a *= texture5_tmp.a;\n #else\n o *= texture5_tmp;\n #endif\n } else if(v_texId < 6.0){\n vec4 texture6_tmp = texture(texture6, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture6\n texture6_tmp.a *= texture(texture6, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n o.a *= texture6_tmp.a;\n #else\n o *= texture6_tmp;\n #endif\n } else if(v_texId < 7.0){\n vec4 texture7_tmp = texture(texture7, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture7\n texture7_tmp.a *= texture(texture7, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n o.a *= texture7_tmp.a;\n #else\n o *= texture7_tmp;\n #endif\n } else {\n vec4 texture8_tmp = texture(texture8, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture8\n texture8_tmp.a *= texture(texture8, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n o.a *= texture8_tmp.a;\n #else\n o *= texture8_tmp;\n #endif\n }\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
@ -4,7 +4,6 @@ import gracefulFs from "graceful-fs";
|
||||
import { Octokit } from 'octokit';
|
||||
import { basename, extname, join } from "path";
|
||||
import { cwd, env } from "process";
|
||||
import { maxSatisfying } from "semver";
|
||||
import { Client } from 'ssh2';
|
||||
import { Zip } from 'zip-lib';
|
||||
const { createReadStream, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } = gracefulFs;
|
||||
@ -151,28 +150,8 @@ if (!DRYRUN) {
|
||||
}
|
||||
console.log("更新文件", spjsPath);
|
||||
|
||||
// 确保存在相应版本的支持性扩展
|
||||
const supportPath = join(masterPath, "extension", `v${kitVersion}`, "enhance-kit-support");
|
||||
if (!existsSync(supportPath)) {
|
||||
const versions = readdirSync(join(masterPath, "extension"));
|
||||
const latestVersion = maxSatisfying(versions, "*");
|
||||
const needCopy = await confirm({
|
||||
message: `未发现 v${kitVersion} 版本的支持性扩展,是否从 ${latestVersion} 拷贝?`,
|
||||
default: true,
|
||||
});
|
||||
if (needCopy) {
|
||||
const src = join(masterPath, "extension", latestVersion);
|
||||
const dest = join(masterPath, "extension", `v${kitVersion}`);
|
||||
|
||||
if (!DRYRUN) {
|
||||
copyDirectory(src, dest);
|
||||
}
|
||||
|
||||
console.log("拷贝目录", src, "->", dest);
|
||||
}
|
||||
}
|
||||
|
||||
// 确保支持性扩展 package.json 版本号正确
|
||||
const supportPath = join(sourcePath, "extension");
|
||||
const supportPackageJsonPath = join(supportPath, "package.json");
|
||||
const supportPackageJson = JSON.parse(readFileSync(supportPackageJsonPath, { encoding: "utf-8" }));
|
||||
supportPackageJson.version = kitVersion;
|
||||
@ -235,7 +214,7 @@ if (!DRYRUN) {
|
||||
console.log("正在压缩", minigamePath);
|
||||
sourceZipFile.addFolder(minigamePath, "adapters");
|
||||
console.log("正在压缩", supportPath);
|
||||
sourceZipFile.addFolder(supportPath, "enhance-kit-support");
|
||||
sourceZipFile.addFolder(supportPath, "extension");
|
||||
console.log("正在压缩", dtsPath);
|
||||
sourceZipFile.addFile(dtsPath);
|
||||
await sourceZipFile.archive(zipPath);
|
||||
|
Loading…
Reference in New Issue
Block a user