drgame-cc 1.0.4 → 1.0.6

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.
Files changed (55) hide show
  1. package/bin/drgame.d.ts +632 -0
  2. package/bin/drgame.js +3010 -0
  3. package/gulpfile.js +68 -0
  4. package/package.json +10 -16
  5. package/scripts/postinstall.js +9 -144
  6. package/tsconfig.json +26 -0
  7. package/tvui/config/default.json +82 -0
  8. package/tvui/config/default.json.meta +6 -0
  9. package/tvui/config.meta +13 -0
  10. package/tvui/icons/pointer-blue-60.png +0 -0
  11. package/tvui/icons/pointer-blue-60.png.meta +38 -0
  12. package/tvui/icons/pointer-pink-60.png +0 -0
  13. package/tvui/icons/pointer-pink-60.png.meta +38 -0
  14. package/tvui/icons/pointer-yellow-60.png +0 -0
  15. package/tvui/icons/pointer-yellow-60.png.meta +38 -0
  16. package/tvui/icons.meta +13 -0
  17. package/tvui/prefab/ExitWin.prefab +765 -0
  18. package/tvui/prefab/ExitWin.prefab.meta +9 -0
  19. package/tvui/prefab/Toast.prefab +379 -0
  20. package/tvui/prefab/Toast.prefab.meta +9 -0
  21. package/tvui/prefab.meta +13 -0
  22. package/tvui/tv_exit/Toast.png +0 -0
  23. package/tvui/tv_exit/Toast.png.meta +38 -0
  24. package/tvui/tv_exit/close.png +0 -0
  25. package/tvui/tv_exit/close.png.meta +38 -0
  26. package/tvui/tv_exit//345/217/226/346/266/210/346/214/211/351/222/256_/346/231/256/351/200/232.png +0 -0
  27. package/tvui/tv_exit//345/217/226/346/266/210/346/214/211/351/222/256_/346/231/256/351/200/232.png.meta +38 -0
  28. package/tvui/tv_exit//345/217/226/346/266/210/346/214/211/351/222/256_/351/200/211/344/270/255.png +0 -0
  29. package/tvui/tv_exit//345/217/226/346/266/210/346/214/211/351/222/256_/351/200/211/344/270/255.png.meta +38 -0
  30. package/tvui/tv_exit//346/241/206.png +0 -0
  31. package/tvui/tv_exit//346/241/206.png.meta +38 -0
  32. package/tvui/tv_exit//347/241/256/350/256/244/346/214/211/351/222/256_/346/231/256/351/200/232.png +0 -0
  33. package/tvui/tv_exit//347/241/256/350/256/244/346/214/211/351/222/256_/346/231/256/351/200/232.png.meta +38 -0
  34. package/tvui/tv_exit//347/241/256/350/256/244/346/214/211/351/222/256_/351/200/211/344/270/255.png +0 -0
  35. package/tvui/tv_exit//347/241/256/350/256/244/346/214/211/351/222/256_/351/200/211/344/270/255.png.meta +38 -0
  36. package/tvui/tv_exit//351/200/200/345/207/272/346/270/270/346/210/217.png +0 -0
  37. package/tvui/tv_exit//351/200/200/345/207/272/346/270/270/346/210/217.png.meta +38 -0
  38. package/tvui/tv_exit.meta +13 -0
  39. package/bin/drgame-cc.js +0 -143
  40. package/dist/asset-exporter.d.ts +0 -134
  41. package/dist/asset-exporter.d.ts.map +0 -1
  42. package/dist/asset-exporter.js +0 -582
  43. package/dist/asset-exporter.js.map +0 -1
  44. package/dist/asset-types.d.ts +0 -190
  45. package/dist/asset-types.d.ts.map +0 -1
  46. package/dist/asset-types.js +0 -24
  47. package/dist/asset-types.js.map +0 -1
  48. package/dist/index.d.ts +0 -8
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -24
  51. package/dist/index.js.map +0 -1
  52. package/dist/utils.d.ts +0 -120
  53. package/dist/utils.d.ts.map +0 -1
  54. package/dist/utils.js +0 -391
  55. package/dist/utils.js.map +0 -1
@@ -0,0 +1,38 @@
1
+ {
2
+ "ver": "2.3.7",
3
+ "uuid": "e97e9745-ce4f-483e-9b7c-9337fe77aaa5",
4
+ "importer": "texture",
5
+ "type": "sprite",
6
+ "wrapMode": "clamp",
7
+ "filterMode": "bilinear",
8
+ "premultiplyAlpha": false,
9
+ "genMipmaps": false,
10
+ "packable": true,
11
+ "width": 395,
12
+ "height": 78,
13
+ "platformSettings": {},
14
+ "subMetas": {
15
+ "退出游戏": {
16
+ "ver": "1.0.6",
17
+ "uuid": "1d7b2665-f028-414f-9cca-e8f7d6ab7a63",
18
+ "importer": "sprite-frame",
19
+ "rawTextureUuid": "e97e9745-ce4f-483e-9b7c-9337fe77aaa5",
20
+ "trimType": "auto",
21
+ "trimThreshold": 1,
22
+ "rotated": false,
23
+ "offsetX": 0,
24
+ "offsetY": 0,
25
+ "trimX": 0,
26
+ "trimY": 0,
27
+ "width": 395,
28
+ "height": 78,
29
+ "rawWidth": 395,
30
+ "rawHeight": 78,
31
+ "borderTop": 0,
32
+ "borderBottom": 0,
33
+ "borderLeft": 0,
34
+ "borderRight": 0,
35
+ "subMetas": {}
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "ver": "1.1.3",
3
+ "uuid": "677b7a59-af7e-4bc8-a5d2-26148e403dfb",
4
+ "importer": "folder",
5
+ "isBundle": false,
6
+ "bundleName": "",
7
+ "priority": 1,
8
+ "compressionType": {},
9
+ "optimizeHotUpdate": {},
10
+ "inlineSpriteFrames": {},
11
+ "isRemoteBundle": {},
12
+ "subMetas": {}
13
+ }
package/bin/drgame-cc.js DELETED
@@ -1,143 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * drgame-cc CLI 工具
5
- * 用于手动触发 build-templates 拷贝
6
- */
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- // 颜色输出
12
- const colors = {
13
- reset: '\x1b[0m',
14
- green: '\x1b[32m',
15
- yellow: '\x1b[33m',
16
- red: '\x1b[31m',
17
- cyan: '\x1b[36m'
18
- };
19
-
20
- function log(message, color = 'reset') {
21
- console.log(`${colors[color]}${message}${colors.reset}`);
22
- }
23
-
24
- /**
25
- * 递归拷贝目录
26
- */
27
- function copyDir(src, dest) {
28
- if (!fs.existsSync(src)) {
29
- return false;
30
- }
31
-
32
- if (!fs.existsSync(dest)) {
33
- fs.mkdirSync(dest, { recursive: true });
34
- }
35
-
36
- const entries = fs.readdirSync(src, { withFileTypes: true });
37
-
38
- for (const entry of entries) {
39
- const srcPath = path.join(src, entry.name);
40
- const destPath = path.join(dest, entry.name);
41
-
42
- if (entry.isDirectory()) {
43
- copyDir(srcPath, destPath);
44
- } else {
45
- fs.copyFileSync(srcPath, destPath);
46
- }
47
- }
48
-
49
- return true;
50
- }
51
-
52
- /**
53
- * 查找项目根目录
54
- */
55
- function findProjectRoot(startDir) {
56
- let currentDir = startDir;
57
-
58
- while (currentDir !== path.dirname(currentDir)) {
59
- if (fs.existsSync(path.join(currentDir, 'assets')) ||
60
- fs.existsSync(path.join(currentDir, 'Assets'))) {
61
- return currentDir;
62
- }
63
- currentDir = path.dirname(currentDir);
64
- }
65
-
66
- return null;
67
- }
68
-
69
- /**
70
- * 拷贝 build-templates
71
- */
72
- function copyBuildTemplates() {
73
- log('========================================', 'cyan');
74
- log('🚀 drgame-cc 拷贝 build-templates', 'cyan');
75
- log('========================================', 'cyan');
76
-
77
- const cwd = process.cwd();
78
- log(`当前目录: ${cwd}`, 'yellow');
79
-
80
- // 查找项目根目录
81
- const projectRoot = findProjectRoot(cwd);
82
-
83
- if (!projectRoot) {
84
- log('⚠️ 未找到 Cocos Creator 项目根目录', 'yellow');
85
- return false;
86
- }
87
-
88
- log(`项目根目录: ${projectRoot}`, 'green');
89
-
90
- // 获取包内的 build-templates 路径
91
- const packageDir = path.resolve(__dirname, '..');
92
- const sourceDir = path.join(packageDir, 'build-templates');
93
- const targetDir = path.join(projectRoot, 'build-templates');
94
-
95
- log(`源目录: ${sourceDir}`, 'yellow');
96
- log(`目标目录: ${targetDir}`, 'yellow');
97
-
98
- // 检查源目录
99
- if (!fs.existsSync(sourceDir)) {
100
- log('⚠️ 包内没有 build-templates 目录', 'yellow');
101
- return false;
102
- }
103
-
104
- // 检查目标目录
105
- if (fs.existsSync(targetDir)) {
106
- log('⚠️ 项目根目录已存在 build-templates,跳过拷贝', 'yellow');
107
- return false;
108
- }
109
-
110
- // 执行拷贝
111
- log('\n📋 开始拷贝...', 'cyan');
112
- const success = copyDir(sourceDir, targetDir);
113
-
114
- if (success) {
115
- log('\n✅ build-templates 拷贝成功!', 'green');
116
- const items = fs.readdirSync(targetDir);
117
- log(`📄 包含 ${items.length} 个文件/目录`, 'cyan');
118
- return true;
119
- } else {
120
- log('\n❌ 拷贝失败', 'red');
121
- return false;
122
- }
123
- }
124
-
125
- // 命令处理
126
- const args = process.argv.slice(2);
127
- const command = args[0];
128
-
129
- switch (command) {
130
- case 'init':
131
- case 'copy-templates':
132
- copyBuildTemplates();
133
- break;
134
- case 'help':
135
- default:
136
- log('drgame-cc CLI 工具', 'cyan');
137
- log('', 'reset');
138
- log('用法:', 'yellow');
139
- log(' npx drgame-cc init 拷贝 build-templates 到项目根目录', 'reset');
140
- log(' npx drgame-cc copy-templates 同上', 'reset');
141
- log(' npx drgame-cc help 显示帮助', 'reset');
142
- break;
143
- }
@@ -1,134 +0,0 @@
1
- /**
2
- * 资源导出器核心类
3
- * 支持导出Cocos Creator项目中的预制体、图片、音乐等资源
4
- */
5
- import { ExportConfig, ExportResult, AssetBundle } from './asset-types';
6
- /**
7
- * 资源导出器类
8
- */
9
- export declare class AssetExporter {
10
- private config;
11
- private exportedAssets;
12
- private errors;
13
- constructor(config: ExportConfig);
14
- /**
15
- * 执行资源导出
16
- * @returns 导出结果
17
- */
18
- export(): Promise<ExportResult>;
19
- /**
20
- * 扫描源目录中的所有资源文件
21
- * @returns 文件路径列表
22
- */
23
- private scanSourceFiles;
24
- /**
25
- * 根据配置过滤文件
26
- * @param files 文件路径列表
27
- * @returns 过滤后的文件列表
28
- */
29
- private filterFilesByType;
30
- /**
31
- * 处理单个文件
32
- * @param filePath 文件路径
33
- */
34
- private processFile;
35
- /**
36
- * 创建资源信息对象
37
- * @param filePath 文件路径
38
- * @param assetType 资源类型
39
- * @returns 资源信息
40
- */
41
- private createAssetInfo;
42
- /**
43
- * 创建图片资源信息
44
- */
45
- private createImageAssetInfo;
46
- /**
47
- * 创建音频资源信息
48
- */
49
- private createAudioAssetInfo;
50
- /**
51
- * 创建预制体资源信息
52
- */
53
- private createPrefabAssetInfo;
54
- /**
55
- * 创建场景资源信息
56
- */
57
- private createSceneAssetInfo;
58
- /**
59
- * 创建脚本资源信息
60
- */
61
- private createScriptAssetInfo;
62
- /**
63
- * 创建动画资源信息
64
- */
65
- private createAnimationAssetInfo;
66
- /**
67
- * 创建字体资源信息
68
- */
69
- private createFontAssetInfo;
70
- /**
71
- * 创建材质资源信息
72
- */
73
- private createMaterialAssetInfo;
74
- /**
75
- * 处理特殊资源类型(如图片压缩、音频转码等)
76
- */
77
- private processSpecialAsset;
78
- /**
79
- * 统计节点数量
80
- */
81
- private countNodes;
82
- /**
83
- * 提取脚本组件
84
- */
85
- private extractScriptComponents;
86
- /**
87
- * 生成资源清单文件
88
- */
89
- private generateManifest;
90
- /**
91
- * 拷贝 build-templates 到 Cocos Creator 项目根目录
92
- */
93
- private copyBuildTemplatesToOutput;
94
- /**
95
- * 查找项目根目录
96
- * @returns 项目根目录路径,如果找不到返回 null
97
- */
98
- private findProjectRoot;
99
- /**
100
- * 打印导出摘要
101
- */
102
- private printSummary;
103
- /**
104
- * 创建资源包
105
- * @param name 包名称
106
- * @param version 包版本
107
- * @param description 包描述
108
- * @returns 资源包对象
109
- */
110
- createAssetBundle(name: string, version?: string, description?: string): AssetBundle;
111
- /**
112
- * 保存资源包到文件
113
- * @param bundle 资源包
114
- * @param outputPath 输出路径
115
- * @returns 是否保存成功
116
- */
117
- saveAssetBundle(bundle: AssetBundle, outputPath: string): boolean;
118
- }
119
- /**
120
- * 快速导出函数
121
- * @param config 导出配置
122
- * @returns 导出结果
123
- */
124
- export declare function exportAssets(config: ExportConfig): Promise<ExportResult>;
125
- /**
126
- * 从Cocos Creator项目导出资源
127
- * @param projectPath 项目路径
128
- * @param outputDir 输出目录
129
- * @param options 额外选项
130
- * @returns 导出结果
131
- */
132
- export declare function exportFromCocosProject(projectPath: string, outputDir: string, options?: Partial<ExportConfig>): Promise<ExportResult>;
133
- export { AssetExporter as default };
134
- //# sourceMappingURL=asset-exporter.d.ts.map
@@ -1 +0,0 @@
1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