@zeewain/3d-avatar-sdk 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/assets/Build/webgl.data.unityweb +0 -0
- package/dist/assets/Build/webgl.framework.js.unityweb +0 -0
- package/dist/assets/Build/webgl.wasm.unityweb +0 -0
- package/dist/examples/test-umd/index.html +762 -0
- package/dist/examples/test-vue2/.eslintignore +45 -0
- package/dist/examples/test-vue2/.eslintrc.js +174 -0
- package/dist/examples/test-vue2/.stylelintignore +50 -0
- package/dist/examples/test-vue2/.stylelintrc.js +79 -0
- package/dist/examples/test-vue2/README.md +139 -0
- package/dist/examples/test-vue2/babel.config.js +14 -0
- package/dist/examples/test-vue2/package.json +53 -0
- package/dist/examples/test-vue2/pnpm-lock.yaml +8776 -0
- package/dist/examples/test-vue2/public/index.html +19 -0
- package/dist/examples/test-vue2/setup.js +170 -0
- package/dist/examples/test-vue2/src/App.vue +943 -0
- package/dist/examples/test-vue2/src/components/BroadcastAPI.vue +666 -0
- package/dist/examples/test-vue2/src/components/CameraAPI.vue +414 -0
- package/dist/examples/test-vue2/src/components/GlobalConfig.vue +200 -0
- package/dist/examples/test-vue2/src/components/InfoCards.vue +294 -0
- package/dist/examples/test-vue2/src/components/InitAPI.vue +334 -0
- package/dist/examples/test-vue2/src/components/LogPanel.vue +249 -0
- package/dist/examples/test-vue2/src/components/MotionControlAPI.vue +400 -0
- package/dist/examples/test-vue2/src/components/UnityPreview.vue +201 -0
- package/dist/examples/test-vue2/src/main.js +16 -0
- package/dist/examples/test-vue2/vue.config.js +41 -0
- package/dist/examples/test-vue3/.eslintrc +3 -0
- package/dist/examples/test-vue3/.stylelintignore +3 -0
- package/dist/examples/test-vue3/.stylelintrc +48 -0
- package/dist/examples/test-vue3/README.md +236 -0
- package/dist/examples/test-vue3/env.d.ts +8 -0
- package/dist/examples/test-vue3/index.html +95 -0
- package/dist/examples/test-vue3/package.json +55 -0
- package/dist/examples/test-vue3/pnpm-lock.yaml +4636 -0
- package/dist/examples/test-vue3/setup.js +167 -0
- package/dist/examples/test-vue3/src/App.vue +962 -0
- package/dist/examples/test-vue3/src/components/BroadcastAPI.vue +636 -0
- package/dist/examples/test-vue3/src/components/CameraAPI.vue +376 -0
- package/dist/examples/test-vue3/src/components/GlobalConfig.vue +213 -0
- package/dist/examples/test-vue3/src/components/InfoCards.vue +288 -0
- package/dist/examples/test-vue3/src/components/InitAPI.vue +339 -0
- package/dist/examples/test-vue3/src/components/LogPanel.vue +236 -0
- package/dist/examples/test-vue3/src/components/MotionControlAPI.vue +373 -0
- package/dist/examples/test-vue3/src/components/UnityPreview.vue +189 -0
- package/dist/examples/test-vue3/src/main.ts +12 -0
- package/dist/examples/test-vue3/src/types.ts +9 -0
- package/dist/examples/test-vue3/tsconfig.json +44 -0
- package/dist/examples/test-vue3/tsconfig.node.json +14 -0
- package/dist/examples/test-vue3/vite.config.ts +75 -0
- package/dist/index.d.ts +15 -9
- package/dist/index.es5.js +64 -17
- package/dist/index.es5.umd.js +64 -17
- package/dist/index.esm.js +71 -16
- package/dist/index.umd.cjs +71 -16
- package/package.json +4 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 依赖目录
|
|
2
|
+
node_modules/
|
|
3
|
+
pnpm-lock.yaml
|
|
4
|
+
package-lock.json
|
|
5
|
+
|
|
6
|
+
# 构建输出
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
public/
|
|
10
|
+
|
|
11
|
+
# 系统文件
|
|
12
|
+
.DS_Store
|
|
13
|
+
Thumbs.db
|
|
14
|
+
|
|
15
|
+
# 编辑器配置
|
|
16
|
+
.vscode/
|
|
17
|
+
.idea/
|
|
18
|
+
*.swp
|
|
19
|
+
*.swo
|
|
20
|
+
*~
|
|
21
|
+
|
|
22
|
+
# 日志文件
|
|
23
|
+
*.log
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
|
|
28
|
+
# 环境变量文件
|
|
29
|
+
.env
|
|
30
|
+
.env.local
|
|
31
|
+
.env.development.local
|
|
32
|
+
.env.test.local
|
|
33
|
+
.env.production.local
|
|
34
|
+
|
|
35
|
+
# 测试覆盖率
|
|
36
|
+
coverage/
|
|
37
|
+
|
|
38
|
+
# 临时文件
|
|
39
|
+
*.tmp
|
|
40
|
+
*.temp
|
|
41
|
+
|
|
42
|
+
# 配置文件
|
|
43
|
+
babel.config.js
|
|
44
|
+
vue.config.js
|
|
45
|
+
setup.js
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true,
|
|
5
|
+
browser: true,
|
|
6
|
+
es6: true
|
|
7
|
+
},
|
|
8
|
+
extends: [
|
|
9
|
+
'plugin:vue/essential',
|
|
10
|
+
'eslint:recommended',
|
|
11
|
+
'standard'
|
|
12
|
+
],
|
|
13
|
+
parserOptions: {
|
|
14
|
+
parser: '@babel/eslint-parser',
|
|
15
|
+
requireConfigFile: false,
|
|
16
|
+
ecmaVersion: 2020,
|
|
17
|
+
sourceType: 'module'
|
|
18
|
+
},
|
|
19
|
+
plugins: [
|
|
20
|
+
'vue'
|
|
21
|
+
],
|
|
22
|
+
rules: {
|
|
23
|
+
// 基础规则
|
|
24
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
25
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
26
|
+
'no-unused-vars': ['error', { args: 'none' }],
|
|
27
|
+
|
|
28
|
+
// Vue特定规则
|
|
29
|
+
'vue/valid-v-if': 'off',
|
|
30
|
+
'vue/multi-word-component-names': 'off',
|
|
31
|
+
'vue/no-unused-components': 'warn',
|
|
32
|
+
'vue/no-unused-vars': 'warn',
|
|
33
|
+
'vue/require-v-for-key': 'error',
|
|
34
|
+
'vue/no-use-v-if-with-v-for': 'error',
|
|
35
|
+
'vue/require-prop-types': 'warn',
|
|
36
|
+
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
37
|
+
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
|
|
38
|
+
'vue/attribute-hyphenation': ['error', 'always'],
|
|
39
|
+
'vue/v-on-event-hyphenation': ['error', 'always'],
|
|
40
|
+
'vue/mustache-interpolation-spacing': ['error', 'always'],
|
|
41
|
+
'vue/html-self-closing': ['error', {
|
|
42
|
+
html: {
|
|
43
|
+
void: 'always',
|
|
44
|
+
normal: 'never',
|
|
45
|
+
component: 'always'
|
|
46
|
+
},
|
|
47
|
+
svg: 'always',
|
|
48
|
+
math: 'always'
|
|
49
|
+
}],
|
|
50
|
+
'vue/html-closing-bracket-newline': ['error', {
|
|
51
|
+
singleline: 'never',
|
|
52
|
+
multiline: 'always'
|
|
53
|
+
}],
|
|
54
|
+
'vue/html-closing-bracket-spacing': ['error', {
|
|
55
|
+
startTag: 'never',
|
|
56
|
+
endTag: 'never',
|
|
57
|
+
selfClosingTag: 'always'
|
|
58
|
+
}],
|
|
59
|
+
'vue/html-indent': ['error', 2, {
|
|
60
|
+
attribute: 1,
|
|
61
|
+
baseIndent: 1,
|
|
62
|
+
closeBracket: 0,
|
|
63
|
+
alignAttributesVertically: true,
|
|
64
|
+
ignores: []
|
|
65
|
+
}],
|
|
66
|
+
'vue/max-attributes-per-line': ['error', {
|
|
67
|
+
singleline: 3,
|
|
68
|
+
multiline: 1
|
|
69
|
+
}],
|
|
70
|
+
'vue/order-in-components': ['error', {
|
|
71
|
+
order: [
|
|
72
|
+
'el',
|
|
73
|
+
'name',
|
|
74
|
+
'key',
|
|
75
|
+
'parent',
|
|
76
|
+
'functional',
|
|
77
|
+
['delimiters', 'comments'],
|
|
78
|
+
['components', 'directives', 'filters'],
|
|
79
|
+
'extends',
|
|
80
|
+
'mixins',
|
|
81
|
+
['provide', 'inject'],
|
|
82
|
+
'ROUTER_GUARDS',
|
|
83
|
+
'layout',
|
|
84
|
+
'middleware',
|
|
85
|
+
'validate',
|
|
86
|
+
'scrollToTop',
|
|
87
|
+
'transition',
|
|
88
|
+
'loading',
|
|
89
|
+
'inheritAttrs',
|
|
90
|
+
'model',
|
|
91
|
+
['props', 'propsData'],
|
|
92
|
+
'emits',
|
|
93
|
+
'setup',
|
|
94
|
+
'asyncData',
|
|
95
|
+
'data',
|
|
96
|
+
'fetch',
|
|
97
|
+
'head',
|
|
98
|
+
'computed',
|
|
99
|
+
'watch',
|
|
100
|
+
'watchQuery',
|
|
101
|
+
'LIFECYCLE_HOOKS',
|
|
102
|
+
'methods',
|
|
103
|
+
['template', 'render'],
|
|
104
|
+
'renderError'
|
|
105
|
+
]
|
|
106
|
+
}],
|
|
107
|
+
|
|
108
|
+
// 代码风格规则
|
|
109
|
+
indent: ['error', 2, {
|
|
110
|
+
SwitchCase: 1,
|
|
111
|
+
MemberExpression: 1,
|
|
112
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
113
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
114
|
+
CallExpression: { arguments: 1 },
|
|
115
|
+
ArrayExpression: 1,
|
|
116
|
+
ObjectExpression: 1,
|
|
117
|
+
ImportDeclaration: 1,
|
|
118
|
+
flatTernaryExpressions: false,
|
|
119
|
+
ignoredNodes: ['TemplateLiteral']
|
|
120
|
+
}],
|
|
121
|
+
quotes: ['error', 'single'],
|
|
122
|
+
semi: ['error', 'never'],
|
|
123
|
+
'comma-dangle': ['error', 'never'],
|
|
124
|
+
'space-before-function-paren': ['error', 'always'],
|
|
125
|
+
'object-curly-spacing': ['error', 'always'],
|
|
126
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
127
|
+
'computed-property-spacing': ['error', 'never'],
|
|
128
|
+
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
129
|
+
'keyword-spacing': ['error', { before: true, after: true }],
|
|
130
|
+
'space-infix-ops': 'error',
|
|
131
|
+
'space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
132
|
+
'spaced-comment': ['error', 'always'],
|
|
133
|
+
'comma-spacing': ['error', { before: false, after: true }],
|
|
134
|
+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
135
|
+
curly: ['error', 'multi-line'],
|
|
136
|
+
'eol-last': ['error', 'always'],
|
|
137
|
+
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 1 }],
|
|
138
|
+
'no-trailing-spaces': 'error',
|
|
139
|
+
'padded-blocks': ['error', 'never'],
|
|
140
|
+
'space-in-parens': ['error', 'never'],
|
|
141
|
+
'arrow-spacing': ['error', { before: true, after: true }],
|
|
142
|
+
'generator-star-spacing': ['error', { before: true, after: true }],
|
|
143
|
+
'yield-star-spacing': ['error', { before: true, after: true }],
|
|
144
|
+
'rest-spread-spacing': ['error', 'never'],
|
|
145
|
+
'template-curly-spacing': ['error', 'never'],
|
|
146
|
+
'object-shorthand': ['error', 'always'],
|
|
147
|
+
'prefer-const': ['error', { destructuring: 'all' }],
|
|
148
|
+
'prefer-template': 'error',
|
|
149
|
+
'prefer-arrow-callback': 'error',
|
|
150
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
151
|
+
'no-var': 'error',
|
|
152
|
+
|
|
153
|
+
// 最佳实践
|
|
154
|
+
eqeqeq: ['error', 'always'],
|
|
155
|
+
'no-eval': 'error',
|
|
156
|
+
'no-implied-eval': 'error',
|
|
157
|
+
'no-new-func': 'error',
|
|
158
|
+
'no-new-wrappers': 'error',
|
|
159
|
+
'no-throw-literal': 'error',
|
|
160
|
+
'no-undef-init': 'error',
|
|
161
|
+
'no-use-before-define': ['error', { functions: false }],
|
|
162
|
+
radix: 'error',
|
|
163
|
+
'wrap-iife': ['error', 'any'],
|
|
164
|
+
yoda: ['error', 'never']
|
|
165
|
+
},
|
|
166
|
+
overrides: [
|
|
167
|
+
{
|
|
168
|
+
files: ['*.vue'],
|
|
169
|
+
rules: {
|
|
170
|
+
indent: 'off'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 依赖目录
|
|
2
|
+
node_modules/
|
|
3
|
+
pnpm-lock.yaml
|
|
4
|
+
package-lock.json
|
|
5
|
+
|
|
6
|
+
# 构建输出
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
public/
|
|
10
|
+
|
|
11
|
+
# 系统文件
|
|
12
|
+
.DS_Store
|
|
13
|
+
Thumbs.db
|
|
14
|
+
|
|
15
|
+
# 编辑器配置
|
|
16
|
+
.vscode/
|
|
17
|
+
.idea/
|
|
18
|
+
*.swp
|
|
19
|
+
*.swo
|
|
20
|
+
*~
|
|
21
|
+
|
|
22
|
+
# 日志文件
|
|
23
|
+
*.log
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
|
|
28
|
+
# 环境变量文件
|
|
29
|
+
.env
|
|
30
|
+
.env.local
|
|
31
|
+
.env.development.local
|
|
32
|
+
.env.test.local
|
|
33
|
+
.env.production.local
|
|
34
|
+
|
|
35
|
+
# 测试覆盖率
|
|
36
|
+
coverage/
|
|
37
|
+
|
|
38
|
+
# 临时文件
|
|
39
|
+
*.tmp
|
|
40
|
+
*.temp
|
|
41
|
+
|
|
42
|
+
# 第三方CSS
|
|
43
|
+
element-ui/
|
|
44
|
+
bootstrap/
|
|
45
|
+
normalize.css
|
|
46
|
+
reset.css
|
|
47
|
+
|
|
48
|
+
# 压缩文件
|
|
49
|
+
*.min.css
|
|
50
|
+
*.min.scss
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'stylelint-config-standard',
|
|
4
|
+
'stylelint-config-standard-scss',
|
|
5
|
+
'stylelint-config-recommended-vue'
|
|
6
|
+
],
|
|
7
|
+
plugins: [
|
|
8
|
+
'stylelint-order'
|
|
9
|
+
],
|
|
10
|
+
rules: {
|
|
11
|
+
// 基础规则
|
|
12
|
+
'no-duplicate-selectors': true,
|
|
13
|
+
'color-hex-length': 'short',
|
|
14
|
+
'function-url-quotes': 'always',
|
|
15
|
+
'comment-whitespace-inside': 'always',
|
|
16
|
+
'rule-empty-line-before': ['always', {
|
|
17
|
+
except: ['first-nested'],
|
|
18
|
+
ignore: ['after-comment']
|
|
19
|
+
}],
|
|
20
|
+
'selector-pseudo-element-colon-notation': 'double',
|
|
21
|
+
|
|
22
|
+
// SCSS特定规则
|
|
23
|
+
'scss/at-rule-no-unknown': true,
|
|
24
|
+
'scss/dollar-variable-colon-space-after': 'always',
|
|
25
|
+
'scss/dollar-variable-colon-space-before': 'never',
|
|
26
|
+
'scss/dollar-variable-no-missing-interpolation': true,
|
|
27
|
+
'scss/dollar-variable-pattern': '^[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
28
|
+
'scss/double-slash-comment-whitespace-inside': 'always',
|
|
29
|
+
'scss/operator-no-newline-before': true,
|
|
30
|
+
'scss/operator-no-unspaced': true,
|
|
31
|
+
'scss/selector-no-redundant-nesting-selector': true,
|
|
32
|
+
'scss/at-mixin-pattern': '^[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
33
|
+
'scss/at-function-pattern': '^[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
34
|
+
'scss/percent-placeholder-pattern': '^[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
35
|
+
|
|
36
|
+
// 选择器规则
|
|
37
|
+
'selector-max-universal': 1,
|
|
38
|
+
'selector-no-vendor-prefix': true,
|
|
39
|
+
|
|
40
|
+
// 值规则
|
|
41
|
+
'value-no-vendor-prefix': true,
|
|
42
|
+
'property-no-vendor-prefix': true,
|
|
43
|
+
|
|
44
|
+
// 长度规则
|
|
45
|
+
'length-zero-no-unit': true,
|
|
46
|
+
'shorthand-property-no-redundant-values': true,
|
|
47
|
+
|
|
48
|
+
// 注释规则
|
|
49
|
+
'comment-empty-line-before': ['always', {
|
|
50
|
+
except: ['first-nested'],
|
|
51
|
+
ignore: ['stylelint-commands']
|
|
52
|
+
}],
|
|
53
|
+
|
|
54
|
+
// 禁用一些过于严格的规则
|
|
55
|
+
'no-descending-specificity': null,
|
|
56
|
+
'font-family-no-missing-generic-family-keyword': null,
|
|
57
|
+
'unit-no-unknown': [true, {
|
|
58
|
+
ignoreUnits: ['rpx']
|
|
59
|
+
}],
|
|
60
|
+
'at-rule-no-unknown': [true, {
|
|
61
|
+
ignoreAtRules: ['include', 'mixin', 'extend', 'if', 'else', 'for', 'each', 'while', 'function', 'return']
|
|
62
|
+
}],
|
|
63
|
+
'selector-class-pattern': null,
|
|
64
|
+
'selector-id-pattern': null,
|
|
65
|
+
'selector-max-id': null,
|
|
66
|
+
'declaration-no-important': null,
|
|
67
|
+
'font-family-name-quotes': null,
|
|
68
|
+
'media-feature-range-notation': null,
|
|
69
|
+
'color-named': null,
|
|
70
|
+
'declaration-property-value-keyword-no-deprecated': null
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// 忽略文件
|
|
74
|
+
ignoreFiles: [
|
|
75
|
+
'node_modules/**/*',
|
|
76
|
+
'dist/**/*',
|
|
77
|
+
'public/**/*'
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# ZEEAvatarSDK Vue2 测试项目
|
|
2
|
+
|
|
3
|
+
这是一个基于Vue2和Element-UI框架的ZEEAvatarSDK测试项目,用于演示和测试SDK的各项功能。
|
|
4
|
+
|
|
5
|
+
## 🚀 快速开始
|
|
6
|
+
|
|
7
|
+
### 环境要求
|
|
8
|
+
- Node.js >= 14.0.0
|
|
9
|
+
- npm >= 6.0.0 或 pnpm >= 7.0.0
|
|
10
|
+
|
|
11
|
+
### 安装依赖
|
|
12
|
+
|
|
13
|
+
使用npm:
|
|
14
|
+
```bash
|
|
15
|
+
npm install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
或使用pnpm:
|
|
19
|
+
```bash
|
|
20
|
+
pnpm install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 启动开发服务器
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 开发模式 (使用本地SDK)
|
|
27
|
+
npm run serve
|
|
28
|
+
# 或
|
|
29
|
+
pnpm run serve
|
|
30
|
+
|
|
31
|
+
# 生产模式 (使用npm SDK)
|
|
32
|
+
npm run serve:npm
|
|
33
|
+
# 或
|
|
34
|
+
pnpm run serve:npm
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 构建生产版本
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run build
|
|
41
|
+
# 或
|
|
42
|
+
pnpm run build
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 🎨 UI框架
|
|
46
|
+
|
|
47
|
+
项目使用Element-UI 2.15.13作为UI框架,提供:
|
|
48
|
+
- 响应式布局设计
|
|
49
|
+
- 统一的组件样式
|
|
50
|
+
- 移动端适配支持
|
|
51
|
+
- 完整的表单验证
|
|
52
|
+
|
|
53
|
+
## 📱 功能特性
|
|
54
|
+
|
|
55
|
+
- **响应式设计**: 支持PC、平板、手机三端
|
|
56
|
+
- **SDK演示**: 完整的API功能测试
|
|
57
|
+
- **实时日志**: 操作日志和状态监控
|
|
58
|
+
- **Unity预览**: 3D数字人实时渲染
|
|
59
|
+
- **配置管理**: 全局Token和Avatar配置
|
|
60
|
+
|
|
61
|
+
## 🛠 技术栈
|
|
62
|
+
|
|
63
|
+
- Vue 2.6.14
|
|
64
|
+
- Element-UI 2.15.13
|
|
65
|
+
- SCSS
|
|
66
|
+
- ZEEAvatarSDK
|
|
67
|
+
- Unity WebGL
|
|
68
|
+
|
|
69
|
+
## 📖 使用说明
|
|
70
|
+
|
|
71
|
+
1. **配置Token和Avatar Code**: 在全局配置区域设置必要的参数
|
|
72
|
+
2. **初始化Avatar**: 点击初始化按钮加载数字人
|
|
73
|
+
3. **测试功能**: 使用左侧面板测试各种API功能
|
|
74
|
+
4. **查看结果**: 在Unity预览区域查看效果,在日志面板查看详细信息
|
|
75
|
+
|
|
76
|
+
## 🔧 开发配置
|
|
77
|
+
|
|
78
|
+
### Element-UI配置
|
|
79
|
+
项目已配置Element-UI按需引入,包括:
|
|
80
|
+
- babel-plugin-component插件
|
|
81
|
+
- 主题样式自动导入
|
|
82
|
+
- 全局组件注册
|
|
83
|
+
|
|
84
|
+
### Babel配置
|
|
85
|
+
```javascript
|
|
86
|
+
module.exports = {
|
|
87
|
+
presets: ['@vue/cli-plugin-babel/preset'],
|
|
88
|
+
plugins: [
|
|
89
|
+
['component', {
|
|
90
|
+
libraryName: 'element-ui',
|
|
91
|
+
styleLibraryName: 'theme-chalk'
|
|
92
|
+
}]
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 📁 项目结构
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
src/
|
|
101
|
+
├── components/ # Vue组件
|
|
102
|
+
│ ├── GlobalConfig.vue # 全局配置
|
|
103
|
+
│ ├── InitAPI.vue # 初始化API
|
|
104
|
+
│ ├── MotionAPI.vue # 动作控制API
|
|
105
|
+
│ ├── BroadcastAPI.vue # 播报API
|
|
106
|
+
│ ├── AvatarAPI.vue # Avatar查询API
|
|
107
|
+
│ ├── ControlAPI.vue # 播报控制API
|
|
108
|
+
│ ├── CameraAPI.vue # 镜头控制API
|
|
109
|
+
│ ├── LogPanel.vue # 日志面板
|
|
110
|
+
│ └── InfoCards.vue # 信息卡片
|
|
111
|
+
├── App.vue # 主应用组件
|
|
112
|
+
└── main.js # 应用入口
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## 🐛 故障排除
|
|
116
|
+
|
|
117
|
+
### 依赖安装问题
|
|
118
|
+
如果遇到依赖安装问题,尝试:
|
|
119
|
+
```bash
|
|
120
|
+
# 清除缓存
|
|
121
|
+
npm cache clean --force
|
|
122
|
+
# 或
|
|
123
|
+
pnpm store prune
|
|
124
|
+
|
|
125
|
+
# 删除node_modules和重新安装
|
|
126
|
+
rm -rf node_modules
|
|
127
|
+
rm -rf pnpm-lock.yaml # 或 package-lock.json
|
|
128
|
+
npm install # 或 pnpm install
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Unity WebGL问题
|
|
132
|
+
确保浏览器支持WebGL:
|
|
133
|
+
- 检查浏览器WebGL支持
|
|
134
|
+
- 禁用硬件加速可能导致问题
|
|
135
|
+
- 确保有足够的内存资源
|
|
136
|
+
|
|
137
|
+
## 📄 许可证
|
|
138
|
+
|
|
139
|
+
此项目仅用于测试和演示目的。
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zee-avatar-sdk-vue2-test",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ZEEAvatarSDK Vue2 测试项目",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"serve": "node setup.js && vue-cli-service serve",
|
|
8
|
+
"serve:npm": "node setup.js --prod && vue-cli-service serve",
|
|
9
|
+
"build": "vue-cli-service build",
|
|
10
|
+
"lint": "vue-cli-service lint",
|
|
11
|
+
"lint:js": "eslint --ext .js,.vue src/",
|
|
12
|
+
"lint:css": "stylelint \"src/**/*.{vue,scss,css}\"",
|
|
13
|
+
"lint:fix": "eslint --ext .js,.vue src/ --fix",
|
|
14
|
+
"lint:css-fix": "stylelint \"src/**/*.{vue,scss,css}\" --fix",
|
|
15
|
+
"lint:all": "npm run lint:js && npm run lint:css",
|
|
16
|
+
"lint:all-fix": "npm run lint:fix && npm run lint:css-fix"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@zeewain/3d-avatar-sdk": "^1.2.2",
|
|
20
|
+
"core-js": "^3.8.3",
|
|
21
|
+
"element-ui": "^2.15.13",
|
|
22
|
+
"vue": "^2.6.14"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/core": "^7.12.16",
|
|
26
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
27
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
28
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
29
|
+
"@vue/cli-service": "~5.0.0",
|
|
30
|
+
"babel-plugin-component": "^1.1.1",
|
|
31
|
+
"eslint": "^8.57.1",
|
|
32
|
+
"eslint-config-standard": "^17.1.0",
|
|
33
|
+
"eslint-plugin-import": "^2.32.0",
|
|
34
|
+
"eslint-plugin-node": "^11.1.0",
|
|
35
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
36
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
37
|
+
"eslint-plugin-vue": "^9.33.0",
|
|
38
|
+
"fs-extra": "^10.1.0",
|
|
39
|
+
"sass": "^1.62.1",
|
|
40
|
+
"sass-loader": "^13.2.2",
|
|
41
|
+
"stylelint": "^16.21.1",
|
|
42
|
+
"stylelint-config-recommended-vue": "^1.6.1",
|
|
43
|
+
"stylelint-config-standard": "^38.0.0",
|
|
44
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
45
|
+
"stylelint-order": "^7.0.0",
|
|
46
|
+
"vue-template-compiler": "^2.6.14"
|
|
47
|
+
},
|
|
48
|
+
"browserslist": [
|
|
49
|
+
"> 1%",
|
|
50
|
+
"last 2 versions",
|
|
51
|
+
"not dead"
|
|
52
|
+
]
|
|
53
|
+
}
|