├── README.md ├── client ├── .gitignore ├── README.md ├── assets │ ├── Scene.meta │ ├── Scene │ │ ├── Game.fire │ │ ├── Game.fire.meta │ │ ├── Load.fire │ │ └── Load.fire.meta │ ├── Script.meta │ ├── Script │ │ ├── Game.meta │ │ ├── Game │ │ │ ├── Bullet.ts │ │ │ ├── Bullet.ts.meta │ │ │ ├── Main.ts │ │ │ ├── Main.ts.meta │ │ │ ├── TrackFollow.ts │ │ │ ├── TrackFollow.ts.meta │ │ │ ├── VortexFollow.ts │ │ │ └── VortexFollow.ts.meta │ │ ├── Global.ts │ │ ├── Global.ts.meta │ │ ├── Load.ts │ │ ├── Load.ts.meta │ │ ├── Modules.meta │ │ ├── Modules │ │ │ ├── wechat.ts │ │ │ ├── wechat.ts.meta │ │ │ ├── wxcontrol.ts │ │ │ ├── wxcontrol.ts.meta │ │ │ ├── wxnetwork.ts │ │ │ ├── wxnetwork.ts.meta │ │ │ ├── wxutils.ts │ │ │ └── wxutils.ts.meta │ │ ├── Popup.meta │ │ ├── Popup │ │ │ ├── Base.ts │ │ │ ├── Base.ts.meta │ │ │ ├── Rank.ts │ │ │ └── Rank.ts.meta │ │ ├── UI.meta │ │ ├── UI │ │ │ ├── TheButton.ts │ │ │ ├── TheButton.ts.meta │ │ │ ├── TheRectMask.ts │ │ │ └── TheRectMask.ts.meta │ │ └── utils │ │ │ ├── CCutils.ts │ │ │ ├── index.ts │ │ │ └── interface.ts │ ├── resources.meta │ ├── resources │ │ ├── audio.meta │ │ ├── audio │ │ │ ├── audio.txt │ │ │ └── audio.txt.meta │ │ ├── images.meta │ │ ├── images │ │ │ ├── white.png │ │ │ └── white.png.meta │ │ ├── prefab.meta │ │ └── prefab │ │ │ ├── rank-box.prefab │ │ │ └── rank-box.prefab.meta │ ├── static.meta │ └── static │ │ ├── audio.meta │ │ ├── audio │ │ ├── audio.txt │ │ └── audio.txt.meta │ │ ├── images.meta │ │ ├── images │ │ ├── battery.png │ │ ├── battery.png.meta │ │ ├── bullet.png │ │ ├── bullet.png.meta │ │ ├── cover.png │ │ ├── cover.png.meta │ │ ├── cup-first.png │ │ ├── cup-first.png.meta │ │ ├── cup-second.png │ │ ├── cup-second.png.meta │ │ ├── cup-third.png │ │ ├── cup-third.png.meta │ │ ├── user-default.png │ │ ├── user-default.png.meta │ │ ├── white.png │ │ └── white.png.meta │ │ ├── prefab.meta │ │ └── prefab │ │ ├── bullet.prefab │ │ ├── bullet.prefab.meta │ │ ├── loading-box.prefab │ │ └── loading-box.prefab.meta ├── creator.d.ts ├── jsconfig.json ├── project.json ├── settings │ ├── builder.json │ ├── builder.panel.json │ ├── project.json │ └── services.json ├── template-banner.png ├── template.json ├── tsconfig.json └── wechat.d.ts └── sub ├── .gitignore ├── assets ├── images.meta ├── images │ ├── bg_rectangle_tyyl.png │ ├── bg_rectangle_tyyl.png.meta │ ├── blue.png │ ├── blue.png.meta │ ├── cup-first.png │ ├── cup-first.png.meta │ ├── cup-second.png │ ├── cup-second.png.meta │ ├── cup-third.png │ ├── cup-third.png.meta │ ├── icon_first.png │ ├── icon_first.png.meta │ ├── icon_second.png │ ├── icon_second.png.meta │ ├── icon_third.png │ ├── icon_third.png.meta │ ├── item-bg.png │ ├── item-bg.png.meta │ ├── user-default.png │ ├── user-default.png.meta │ ├── user.png │ ├── user.png.meta │ ├── white.png │ └── white.png.meta ├── item.prefab ├── item.prefab.meta ├── launch.fire ├── launch.fire.meta ├── launch.js └── launch.js.meta ├── creator.d.ts ├── jsconfig.json ├── project.json └── settings ├── builder.json └── project.json /README.md: -------------------------------------------------------------------------------- 1 | # cocos creator 小游戏模板(主要集成了微信端) 2 | 3 | > 针对小游戏开发逻辑使用,因为小游戏不同于大型游戏,逻辑不是很复杂,所以我这里就不做事件派发和脚本联动的处理机制了,而是通过一个全局模块去管理各个模块和调用(更好的代码提示和追踪)。 4 | 5 | > 大概说一下我的跨文件编程思维:通过全局对象`Global`去定义实例化的对象,然后其他脚本调用某个文件的方法时候就 `Global.ModuleXXX.fun()` 6 | 7 | **示例** 8 | ```js 9 | // 主要脚本对象 Main.js 10 | onload() { 11 | Global.Game = this; 12 | } 13 | 14 | // 假设我在游戏主函数 Main.js 定义了一个对象池 15 | this.bulletPool = new cc.NodePool(); 16 | 17 | // 然后在 Bullet.js 中进行回收当前节点到对象池中,那么就可以这样写 18 | Global.Game.bulletPool.put(this.node); 19 | 20 | ``` 21 | 22 | ### 功能清单 23 | 24 | **1. 微信常用功能模块** 25 | ```js 26 | /** 27 | * 使用思路 28 | * 游戏加载页初始化微信工具(不在微信端可以忽略),我的游戏逻辑是先进游戏加载场景,然后再进游戏主逻辑场景,一共两个场景。 29 | * 这样的好处就是1、微信小程序打开速度会很快2、在加载场景中只做初始化的一些操作,游戏场景只做游戏相关的内容,两者更加清晰。 30 | */ 31 | // 示例中我是通过与后台接口设置游戏中的参数,具体看代码注释即可 32 | // 在`onload` & `start`方法中,始化微信控件 33 | WeChat.initShare(); 34 | WeChat.initBanner(); 35 | WeChat.checkVideo(); 36 | 37 | // 之后在其他地方使用主动拉起分享 38 | WeChat.share(); 39 | // 需要分享回调这样写 40 | WeChat.share(function() { 41 | // 注意这里微信已经取消了分享回调,而我这边是用wx.onhide和wx.onshow去模拟的分享回调 42 | // 分享的规则和文案提示自行看代码注释修改即可 43 | console.log('分享成功'); 44 | }); 45 | 46 | // 拉起广告视频 47 | WeChat.showVideo(function() { 48 | console.log('观看完15s视频'); 49 | }); 50 | 51 | // 显示 & 隐藏`banner` 52 | WeChat.showBanner(); 53 | WeChat.hideBanner(); 54 | ``` 55 | **2. 游戏常用功能模块** 56 | ```js 57 | // 在游戏主场景中初始化预制体加载框 58 | // this.loadingBox => 加载框预制体,具体节点布局在编辑器可以查看 59 | utils.setLoadingBox(cc.instantiate(this.loadingBox), this.node); 60 | 61 | // 使用加载框加载预制体 ---- 预制体存放目录 static/prefab/ 62 | utils.loadPrefab('加载的预制体名字', res => { 63 | console.log('加载完成', res); 64 | }); 65 | 66 | // 使用动态加载本地图片到指定节点下 67 | utils.loadImg(node, 'xxx', res => { 68 | console.log('图片加载完成', res); 69 | }); 70 | 71 | // 使用动态加载网络图片到指定节点下 72 | utils.loadNetImg(node, 'xxx', '.jpg'); 73 | ``` 74 | **3. 微信子域代码(sub目录)使用这里我就不说了,代码注释有** 75 | 76 | **4. 自定义的 cocos creator component 使用个人觉得非常好用,建议常用的组件都自行定义使用 Script/UI/目录下我定义了`2`个常用的,使用时直接拖拽到组件栏或者从选项中添加即可** 77 | 78 | **5. `Main.js/Main.ts`脚本中实现了一些简单的运动功能,某些游戏可能用到,后续可能继续增加...** 79 | 80 | **6. 小游戏的数据存储是优先存储在本地的,其次到服务端。然后在加载页的时候获取本地数据,如果本地数据没有,再从服务端拿取。这样用户换设备使用同一个小程序的时候就可以保证数据不丢失了。** 81 | 82 | ### 结构目录 83 | * client 游戏主程序 84 | * sub 游戏子域 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # 没有介绍 请看代码 2 | 3 | -------------------------------------------------------------------------------- /client/assets/Scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /client/assets/Scene/Game.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "uuid": "5e0fbff6-0139-4705-9c93-b2329571c9fc", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Scene/Load.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_active": true, 21 | "_level": 0, 22 | "_components": [], 23 | "_prefab": null, 24 | "_opacity": 255, 25 | "_color": { 26 | "__type__": "cc.Color", 27 | "r": 255, 28 | "g": 255, 29 | "b": 255, 30 | "a": 255 31 | }, 32 | "_contentSize": { 33 | "__type__": "cc.Size", 34 | "width": 0, 35 | "height": 0 36 | }, 37 | "_anchorPoint": { 38 | "__type__": "cc.Vec2", 39 | "x": 0, 40 | "y": 0 41 | }, 42 | "_scale": { 43 | "__type__": "cc.Vec3", 44 | "x": 1, 45 | "y": 1, 46 | "z": 1 47 | }, 48 | "_quat": { 49 | "__type__": "cc.Quat", 50 | "x": 0, 51 | "y": 0, 52 | "z": 0, 53 | "w": 1 54 | }, 55 | "_is3DNode": true, 56 | "groupIndex": 0, 57 | "autoReleaseAssets": false, 58 | "_id": "71d9ea15-30dc-4623-bb84-e9f8ec8f9ed9" 59 | }, 60 | { 61 | "__type__": "cc.Node", 62 | "_name": "Canvas", 63 | "_objFlags": 0, 64 | "_parent": { 65 | "__id__": 1 66 | }, 67 | "_children": [ 68 | { 69 | "__id__": 3 70 | }, 71 | { 72 | "__id__": 5 73 | }, 74 | { 75 | "__id__": 8 76 | }, 77 | { 78 | "__id__": 10 79 | }, 80 | { 81 | "__id__": 12 82 | } 83 | ], 84 | "_active": true, 85 | "_level": 0, 86 | "_components": [ 87 | { 88 | "__id__": 14 89 | }, 90 | { 91 | "__id__": 15 92 | } 93 | ], 94 | "_prefab": null, 95 | "_opacity": 255, 96 | "_color": { 97 | "__type__": "cc.Color", 98 | "r": 255, 99 | "g": 255, 100 | "b": 255, 101 | "a": 255 102 | }, 103 | "_contentSize": { 104 | "__type__": "cc.Size", 105 | "width": 750, 106 | "height": 1334 107 | }, 108 | "_anchorPoint": { 109 | "__type__": "cc.Vec2", 110 | "x": 0.5, 111 | "y": 0.5 112 | }, 113 | "_position": { 114 | "__type__": "cc.Vec3", 115 | "x": 375, 116 | "y": 667, 117 | "z": 0 118 | }, 119 | "_scale": { 120 | "__type__": "cc.Vec3", 121 | "x": 1, 122 | "y": 1, 123 | "z": 1 124 | }, 125 | "_quat": { 126 | "__type__": "cc.Quat", 127 | "x": 0, 128 | "y": 0, 129 | "z": 0, 130 | "w": 1 131 | }, 132 | "_skewX": 0, 133 | "_skewY": 0, 134 | "_is3DNode": false, 135 | "groupIndex": 0, 136 | "_id": "96iAwrPnxNaqSEGpKEbJlg" 137 | }, 138 | { 139 | "__type__": "cc.Node", 140 | "_name": "Main Camera", 141 | "_objFlags": 0, 142 | "_parent": { 143 | "__id__": 2 144 | }, 145 | "_children": [], 146 | "_active": true, 147 | "_level": 1, 148 | "_components": [ 149 | { 150 | "__id__": 4 151 | } 152 | ], 153 | "_prefab": null, 154 | "_opacity": 255, 155 | "_color": { 156 | "__type__": "cc.Color", 157 | "r": 255, 158 | "g": 255, 159 | "b": 255, 160 | "a": 255 161 | }, 162 | "_contentSize": { 163 | "__type__": "cc.Size", 164 | "width": 0, 165 | "height": 0 166 | }, 167 | "_anchorPoint": { 168 | "__type__": "cc.Vec2", 169 | "x": 0.5, 170 | "y": 0.5 171 | }, 172 | "_position": { 173 | "__type__": "cc.Vec3", 174 | "x": 0, 175 | "y": 0, 176 | "z": 0 177 | }, 178 | "_scale": { 179 | "__type__": "cc.Vec3", 180 | "x": 1, 181 | "y": 1, 182 | "z": 1 183 | }, 184 | "_quat": { 185 | "__type__": "cc.Quat", 186 | "x": 0, 187 | "y": 0, 188 | "z": 0, 189 | "w": 1 190 | }, 191 | "_skewX": 0, 192 | "_skewY": 0, 193 | "_is3DNode": false, 194 | "groupIndex": 0, 195 | "_id": "39T4cmpoJMZqnep3v5Hvze" 196 | }, 197 | { 198 | "__type__": "cc.Camera", 199 | "_name": "", 200 | "_objFlags": 0, 201 | "node": { 202 | "__id__": 3 203 | }, 204 | "_enabled": true, 205 | "_cullingMask": 4294967295, 206 | "_clearFlags": 7, 207 | "_backgroundColor": { 208 | "__type__": "cc.Color", 209 | "r": 0, 210 | "g": 0, 211 | "b": 0, 212 | "a": 255 213 | }, 214 | "_depth": -1, 215 | "_zoomRatio": 1, 216 | "_targetTexture": null, 217 | "_fov": 60, 218 | "_orthoSize": 10, 219 | "_nearClip": 0.1, 220 | "_farClip": 4096, 221 | "_ortho": true, 222 | "_rect": { 223 | "__type__": "cc.Rect", 224 | "x": 0, 225 | "y": 0, 226 | "width": 1, 227 | "height": 1 228 | }, 229 | "_renderStages": 1, 230 | "_id": "eba8ACyzBPLYBgZHk16DOO" 231 | }, 232 | { 233 | "__type__": "cc.Node", 234 | "_name": "white", 235 | "_objFlags": 0, 236 | "_parent": { 237 | "__id__": 2 238 | }, 239 | "_children": [], 240 | "_active": true, 241 | "_level": 1, 242 | "_components": [ 243 | { 244 | "__id__": 6 245 | }, 246 | { 247 | "__id__": 7 248 | } 249 | ], 250 | "_prefab": null, 251 | "_opacity": 255, 252 | "_color": { 253 | "__type__": "cc.Color", 254 | "r": 255, 255 | "g": 255, 256 | "b": 255, 257 | "a": 255 258 | }, 259 | "_contentSize": { 260 | "__type__": "cc.Size", 261 | "width": 750, 262 | "height": 1334 263 | }, 264 | "_anchorPoint": { 265 | "__type__": "cc.Vec2", 266 | "x": 0.5, 267 | "y": 0.5 268 | }, 269 | "_position": { 270 | "__type__": "cc.Vec3", 271 | "x": 0, 272 | "y": 0, 273 | "z": 0 274 | }, 275 | "_scale": { 276 | "__type__": "cc.Vec3", 277 | "x": 1, 278 | "y": 1, 279 | "z": 1 280 | }, 281 | "_quat": { 282 | "__type__": "cc.Quat", 283 | "x": 0, 284 | "y": 0, 285 | "z": 0, 286 | "w": 1 287 | }, 288 | "_skewX": 0, 289 | "_skewY": 0, 290 | "_is3DNode": false, 291 | "groupIndex": 0, 292 | "_id": "2e0f0aqQBMgrIe60Nht73Z" 293 | }, 294 | { 295 | "__type__": "cc.Sprite", 296 | "_name": "", 297 | "_objFlags": 0, 298 | "node": { 299 | "__id__": 5 300 | }, 301 | "_enabled": true, 302 | "_materials": [], 303 | "_srcBlendFactor": 770, 304 | "_dstBlendFactor": 771, 305 | "_spriteFrame": { 306 | "__uuid__": "303e3022-1ffc-4eca-a494-348bba5200dd" 307 | }, 308 | "_type": 1, 309 | "_sizeMode": 0, 310 | "_fillType": 0, 311 | "_fillCenter": { 312 | "__type__": "cc.Vec2", 313 | "x": 0, 314 | "y": 0 315 | }, 316 | "_fillStart": 0, 317 | "_fillRange": 0, 318 | "_isTrimmedMode": true, 319 | "_atlas": null, 320 | "_id": "c9TtzxxqNDiIWADRBf7l12" 321 | }, 322 | { 323 | "__type__": "cc.Widget", 324 | "_name": "", 325 | "_objFlags": 0, 326 | "node": { 327 | "__id__": 5 328 | }, 329 | "_enabled": true, 330 | "alignMode": 1, 331 | "_target": null, 332 | "_alignFlags": 45, 333 | "_left": 0, 334 | "_right": 0, 335 | "_top": 0, 336 | "_bottom": 0, 337 | "_verticalCenter": 0, 338 | "_horizontalCenter": 0, 339 | "_isAbsLeft": true, 340 | "_isAbsRight": true, 341 | "_isAbsTop": true, 342 | "_isAbsBottom": true, 343 | "_isAbsHorizontalCenter": true, 344 | "_isAbsVerticalCenter": true, 345 | "_originalWidth": 10, 346 | "_originalHeight": 10, 347 | "_id": "bcQkSNECBHlayeCIC9XhQ6" 348 | }, 349 | { 350 | "__type__": "cc.Node", 351 | "_name": "cover", 352 | "_objFlags": 0, 353 | "_parent": { 354 | "__id__": 2 355 | }, 356 | "_children": [], 357 | "_active": true, 358 | "_level": 1, 359 | "_components": [ 360 | { 361 | "__id__": 9 362 | } 363 | ], 364 | "_prefab": null, 365 | "_opacity": 255, 366 | "_color": { 367 | "__type__": "cc.Color", 368 | "r": 255, 369 | "g": 255, 370 | "b": 255, 371 | "a": 255 372 | }, 373 | "_contentSize": { 374 | "__type__": "cc.Size", 375 | "width": 500, 376 | "height": 15 377 | }, 378 | "_anchorPoint": { 379 | "__type__": "cc.Vec2", 380 | "x": 0.5, 381 | "y": 0.5 382 | }, 383 | "_position": { 384 | "__type__": "cc.Vec3", 385 | "x": 0, 386 | "y": 0, 387 | "z": 0 388 | }, 389 | "_scale": { 390 | "__type__": "cc.Vec3", 391 | "x": 1, 392 | "y": 1, 393 | "z": 1 394 | }, 395 | "_quat": { 396 | "__type__": "cc.Quat", 397 | "x": 0, 398 | "y": 0, 399 | "z": 0, 400 | "w": 1 401 | }, 402 | "_skewX": 0, 403 | "_skewY": 0, 404 | "_is3DNode": false, 405 | "groupIndex": 0, 406 | "_id": "a2ZD6u97lDo7yITprtSDJj" 407 | }, 408 | { 409 | "__type__": "cc.Sprite", 410 | "_name": "", 411 | "_objFlags": 0, 412 | "node": { 413 | "__id__": 8 414 | }, 415 | "_enabled": true, 416 | "_materials": [], 417 | "_srcBlendFactor": 770, 418 | "_dstBlendFactor": 771, 419 | "_spriteFrame": { 420 | "__uuid__": "8ae99863-a1bc-432e-8c57-c708d90e3c9d" 421 | }, 422 | "_type": 1, 423 | "_sizeMode": 0, 424 | "_fillType": 0, 425 | "_fillCenter": { 426 | "__type__": "cc.Vec2", 427 | "x": 0, 428 | "y": 0 429 | }, 430 | "_fillStart": 0, 431 | "_fillRange": 0, 432 | "_isTrimmedMode": true, 433 | "_atlas": null, 434 | "_id": "8aiACPWKdA2LdJ2l4SYZQ+" 435 | }, 436 | { 437 | "__type__": "cc.Node", 438 | "_name": "progress", 439 | "_objFlags": 0, 440 | "_parent": { 441 | "__id__": 2 442 | }, 443 | "_children": [], 444 | "_active": true, 445 | "_level": 1, 446 | "_components": [ 447 | { 448 | "__id__": 11 449 | } 450 | ], 451 | "_prefab": null, 452 | "_opacity": 255, 453 | "_color": { 454 | "__type__": "cc.Color", 455 | "r": 41, 456 | "g": 109, 457 | "b": 226, 458 | "a": 255 459 | }, 460 | "_contentSize": { 461 | "__type__": "cc.Size", 462 | "width": 500, 463 | "height": 15 464 | }, 465 | "_anchorPoint": { 466 | "__type__": "cc.Vec2", 467 | "x": 0, 468 | "y": 0.5 469 | }, 470 | "_position": { 471 | "__type__": "cc.Vec3", 472 | "x": -250, 473 | "y": 0, 474 | "z": 0 475 | }, 476 | "_scale": { 477 | "__type__": "cc.Vec3", 478 | "x": 1, 479 | "y": 1, 480 | "z": 1 481 | }, 482 | "_quat": { 483 | "__type__": "cc.Quat", 484 | "x": 0, 485 | "y": 0, 486 | "z": 0, 487 | "w": 1 488 | }, 489 | "_skewX": 0, 490 | "_skewY": 0, 491 | "_is3DNode": false, 492 | "groupIndex": 0, 493 | "_id": "7fsnjTp6RLpY9NIo2ZB4VV" 494 | }, 495 | { 496 | "__type__": "cc.Sprite", 497 | "_name": "", 498 | "_objFlags": 0, 499 | "node": { 500 | "__id__": 10 501 | }, 502 | "_enabled": true, 503 | "_materials": [], 504 | "_srcBlendFactor": 770, 505 | "_dstBlendFactor": 771, 506 | "_spriteFrame": { 507 | "__uuid__": "303e3022-1ffc-4eca-a494-348bba5200dd" 508 | }, 509 | "_type": 2, 510 | "_sizeMode": 0, 511 | "_fillType": 0, 512 | "_fillCenter": { 513 | "__type__": "cc.Vec2", 514 | "x": 0, 515 | "y": 0 516 | }, 517 | "_fillStart": 0, 518 | "_fillRange": 0, 519 | "_isTrimmedMode": true, 520 | "_atlas": null, 521 | "_id": "f3KiDPuEdK9obJOhGrt7Up" 522 | }, 523 | { 524 | "__type__": "cc.Node", 525 | "_name": "load-text", 526 | "_objFlags": 0, 527 | "_parent": { 528 | "__id__": 2 529 | }, 530 | "_children": [], 531 | "_active": true, 532 | "_level": 1, 533 | "_components": [ 534 | { 535 | "__id__": 13 536 | } 537 | ], 538 | "_prefab": null, 539 | "_opacity": 255, 540 | "_color": { 541 | "__type__": "cc.Color", 542 | "r": 255, 543 | "g": 171, 544 | "b": 0, 545 | "a": 255 546 | }, 547 | "_contentSize": { 548 | "__type__": "cc.Size", 549 | "width": 90, 550 | "height": 50.4 551 | }, 552 | "_anchorPoint": { 553 | "__type__": "cc.Vec2", 554 | "x": 0.5, 555 | "y": 0.5 556 | }, 557 | "_position": { 558 | "__type__": "cc.Vec3", 559 | "x": 0, 560 | "y": -40, 561 | "z": 0 562 | }, 563 | "_scale": { 564 | "__type__": "cc.Vec3", 565 | "x": 1, 566 | "y": 1, 567 | "z": 1 568 | }, 569 | "_quat": { 570 | "__type__": "cc.Quat", 571 | "x": 0, 572 | "y": 0, 573 | "z": 0, 574 | "w": 1 575 | }, 576 | "_skewX": 0, 577 | "_skewY": 0, 578 | "_is3DNode": false, 579 | "groupIndex": 0, 580 | "_rotationX": 0, 581 | "_rotationY": 0, 582 | "_id": "e7NvviAwZBAbOcfKp17Za8" 583 | }, 584 | { 585 | "__type__": "cc.Label", 586 | "_name": "", 587 | "_objFlags": 0, 588 | "node": { 589 | "__id__": 12 590 | }, 591 | "_enabled": true, 592 | "_materials": [], 593 | "_useOriginalSize": false, 594 | "_string": "加载中", 595 | "_N$string": "加载中", 596 | "_fontSize": 30, 597 | "_lineHeight": 40, 598 | "_enableWrapText": true, 599 | "_N$file": null, 600 | "_isSystemFontUsed": true, 601 | "_spacingX": 0, 602 | "_batchAsBitmap": false, 603 | "_N$horizontalAlign": 1, 604 | "_N$verticalAlign": 1, 605 | "_N$fontFamily": "Arial", 606 | "_N$overflow": 0, 607 | "_N$cacheMode": 0, 608 | "_id": "3aKwydIX1Ftollvq0l6kxw" 609 | }, 610 | { 611 | "__type__": "cc.Canvas", 612 | "_name": "", 613 | "_objFlags": 0, 614 | "node": { 615 | "__id__": 2 616 | }, 617 | "_enabled": true, 618 | "_designResolution": { 619 | "__type__": "cc.Size", 620 | "width": 750, 621 | "height": 1334 622 | }, 623 | "_fitWidth": true, 624 | "_fitHeight": false, 625 | "_id": "ecy3le92pHMrFY0ATwsUHc" 626 | }, 627 | { 628 | "__type__": "53f54yw5FlAe43+Tg6oLa/Z", 629 | "_name": "", 630 | "_objFlags": 0, 631 | "node": { 632 | "__id__": 2 633 | }, 634 | "_enabled": true, 635 | "text": { 636 | "__id__": 13 637 | }, 638 | "line": { 639 | "__id__": 10 640 | }, 641 | "_id": "aa8bU3H2ZBnaB7pLGsCGy1" 642 | } 643 | ] -------------------------------------------------------------------------------- /client/assets/Scene/Load.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "uuid": "71d9ea15-30dc-4623-bb84-e9f8ec8f9ed9", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /client/assets/Script/Game.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ea32c9a7-b709-49a1-822b-e0e35085f367", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Script/Game/Bullet.ts: -------------------------------------------------------------------------------- 1 | import Global from "../Global"; 2 | 3 | const { ccclass, property, menu } = cc._decorator; 4 | 5 | @ccclass() 6 | @menu("Game/子弹脚本") 7 | export default class Bullet extends cc.Component { 8 | /** 子弹速度 */ 9 | @property({ 10 | displayName: "子弹速度", 11 | }) 12 | private speed: number = 800; 13 | 14 | /** 子弹旋转角度 */ 15 | @property({ 16 | displayName: "子弹旋转角度", 17 | }) 18 | private angle: number = 0; 19 | 20 | /** 发射 */ 21 | private launch: boolean = false; 22 | 23 | /** 节点回收范围 */ 24 | private range = {w: 0, h: 0} 25 | 26 | /** 初始化 */ 27 | private init() { 28 | /** 发射点 */ 29 | let size = 80; 30 | /** 发射的炮台 */ 31 | let node = Global.Game.batteryNode; 32 | this.node.angle = this.angle = node.angle; 33 | /** 转换成自己的坐标 */ 34 | let pos = cc.v2(node.x - size * Math.sin(this.angle / 180 * 3.14), node.y + size * Math.cos(this.angle / 180 * 3.14)); 35 | this.node.position = pos; 36 | this.launch = true; 37 | } 38 | 39 | // LIFE-CYCLE CALLBACKS: 40 | 41 | onEnable() { 42 | this.init(); 43 | } 44 | 45 | onLoad() { 46 | let w = this.node.width / 2; 47 | 48 | this.range = { 49 | w: cc.winSize.width / 2 + w, 50 | h: cc.winSize.height / 2 + w 51 | } 52 | } 53 | 54 | // start () {} 55 | 56 | update (dt: number) { 57 | if (!this.launch) return; 58 | 59 | this.node.x -= dt * this.speed * Math.sin(this.angle / 180 * 3.14); 60 | this.node.y += dt * this.speed * Math.cos(this.angle / 180 * 3.14); 61 | 62 | /** 检测是否相交 */ 63 | let intersects = this.node.getBoundingBoxToWorld().intersects(Global.Game.ball.getBoundingBoxToWorld()); 64 | 65 | if (intersects) { 66 | this.launch = false; 67 | Global.Game.putBullet(this.node); 68 | return Global.Game.setBoxColor(); 69 | // return cc.log("子弹击中白色盒子"); 70 | } 71 | 72 | if (this.node.x > this.range.w || this.node.x < -this.range.w || this.node.y > this.range.h || this.node.y < -this.range.h) { 73 | this.launch = false; 74 | Global.Game.putBullet(this.node); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /client/assets/Script/Game/Bullet.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "34461deb-1d29-4231-8932-520d69730e34", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Game/Main.ts: -------------------------------------------------------------------------------- 1 | import Global from "../Global"; 2 | import WeChat from "../Modules/wechat"; 3 | import utils from "../utils"; 4 | 5 | const { ccclass, property, menu } = cc._decorator; 6 | 7 | @ccclass() 8 | @menu('Game/主程序') 9 | export default class Main extends cc.Component { 10 | /** 移动的物体 */ 11 | @property(cc.Node) 12 | public ball: cc.Node = null; 13 | 14 | /** 炮台 */ 15 | @property(cc.Node) 16 | public batteryNode: cc.Node = null; 17 | 18 | @property(cc.Node) 19 | public targetNode: cc.Node = null; 20 | 21 | /** 子弹预制体 */ 22 | @property(cc.Prefab) 23 | protected bulletPrefab: cc.Prefab = null; 24 | 25 | /** 加载框 */ 26 | @property(cc.Prefab) 27 | public loadingBox: cc.Prefab = null; 28 | 29 | /** 子弹对象池 */ 30 | private readonly bulletPool: Array = []; 31 | 32 | /** 速度状态 */ 33 | protected sppedState: boolean = false; 34 | 35 | /** 速度倍数 */ 36 | protected speed: number = 1; 37 | 38 | /** 缓动系数 */ 39 | protected value: number = 30; 40 | 41 | /** 排行榜 */ 42 | public rankBox: cc.Node = null; 43 | 44 | /** 打开排行榜 */ 45 | public openRank() { 46 | if (this.rankBox) { 47 | this.rankBox.active = true; 48 | } else { 49 | utils.loadPrefab('rank-box', res => { 50 | this.rankBox = cc.instantiate(res); 51 | this.rankBox.parent = this.node; 52 | }); 53 | } 54 | } 55 | 56 | /** 分享或者看视频 */ 57 | public testShare() { 58 | WeChat.getReward(function () { 59 | console.log('领取成功!!!!!'); 60 | }, 'xxx'); 61 | } 62 | 63 | /** 设置 ball 颜色 */ 64 | public setBoxColor() { 65 | let color = { 66 | r: Math.floor(255 * Math.random()) + 1, 67 | g: Math.floor(255 * Math.random()) + 1, 68 | b: Math.floor(255 * Math.random()) + 1 69 | } 70 | // this.ball.color = new cc.color(color); 71 | const image = cc.find('image', this.ball); 72 | image.color = cc.color(color.r, color.g, color.b); 73 | } 74 | 75 | /** 从对象池获取子弹 */ 76 | public getBullet() { 77 | let bullet: cc.Node = null; 78 | if (this.bulletPool.length > 0) { 79 | bullet = this.bulletPool.shift(); 80 | } else { 81 | bullet = cc.instantiate(this.bulletPrefab); 82 | } 83 | return bullet; 84 | } 85 | 86 | /** 87 | * 回收子弹节点到对象池中 88 | * @param bullet 子弹节点 89 | */ 90 | public putBullet(bullet: cc.Node) { 91 | bullet.removeFromParent(true); 92 | this.bulletPool.push(bullet); 93 | } 94 | 95 | /** 创建子弹对象池 */ 96 | private createBulletPool() { 97 | for (let i = 0; i < 10; i++) { 98 | let bullet = cc.instantiate(this.bulletPrefab); 99 | this.bulletPool.push(bullet); 100 | } 101 | } 102 | 103 | /** 发射 */ 104 | private launch(event: any) { 105 | // console.log(event, event.touch, event.touch._point); 106 | /** 点击的坐标位置 */ 107 | let clickPosition = this.node.convertToNodeSpaceAR(event.touch._point); 108 | /** 旋转目标节点位置 */ 109 | let nodePosition = this.batteryNode.getPosition(); 110 | /** 弧度 */ 111 | let radian = 0; 112 | /** 角度 */ 113 | let angle = 0; 114 | 115 | // 方法一: 116 | if (clickPosition.y < nodePosition.y) { 117 | // 炮台向下 118 | radian = Math.atan((clickPosition.x - nodePosition.x) / (nodePosition.y - clickPosition.y)); 119 | angle = radian * 180 / Math.PI + 180; 120 | } else { 121 | // 炮台向上 122 | radian = Math.atan((nodePosition.x - clickPosition.x) / (clickPosition.y - nodePosition.y)); 123 | angle = radian * 180 / Math.PI; 124 | } 125 | 126 | /** 127 | * 方法二: 128 | * 只有旋转节点坐标为(0, 0)才生效 所以要做下坐标偏移 129 | */ 130 | // clickPosition.x = clickPosition.x - nodePosition.x; 131 | // clickPosition.y = clickPosition.y - nodePosition.y; 132 | // angle = utils.rotateAngle(clickPosition.x, clickPosition.y); 133 | 134 | // 最后节点角度旋转 135 | this.batteryNode.angle = angle; 136 | // console.log(angle); 137 | 138 | const bullet = this.getBullet(); 139 | bullet.parent = this.node; 140 | } 141 | 142 | /** 初始化子弹发射 */ 143 | private initLaunch() { 144 | this.node.on('touchstart', this.launch, this); 145 | this.node.on('touchmove', this.launch, this); 146 | } 147 | 148 | /** 速度切换 */ 149 | public speedSwitch() { 150 | if (this.sppedState) { 151 | this.sppedState = false; 152 | this.speed = 1; 153 | } else { 154 | this.sppedState = true; 155 | this.speed = 0.2; 156 | } 157 | } 158 | 159 | /** 加速 */ 160 | public accelerate() { 161 | this.speed = 2; 162 | } 163 | 164 | /** 初始目标位置 */ 165 | private initTargetNode() { 166 | const left = this.node.width / 2 - this.targetNode.width / 2 - 10; 167 | const top = this.node.height / 2 - this.targetNode.height / 2 - 10; 168 | const positionList = [ 169 | { 170 | x: left, 171 | y: top 172 | }, { 173 | x: left, 174 | y: -top 175 | }, { 176 | x: -left, 177 | y: top 178 | }, { 179 | x: -left, 180 | y: -top 181 | } 182 | ] 183 | 184 | this.targetNode.runAction( 185 | cc.repeatForever( 186 | cc.sequence( 187 | cc.moveTo(2, cc.v2(positionList[0])), 188 | cc.moveTo(2, cc.v2(positionList[2])), 189 | cc.moveTo(2, cc.v2(positionList[3])), 190 | cc.moveTo(2, cc.v2(positionList[1])), 191 | ) 192 | ) 193 | ); 194 | } 195 | 196 | // LIFE-CYCLE CALLBACKS: 197 | 198 | onLoad() { 199 | Global.Game = this; 200 | this.createBulletPool(); 201 | this.initLaunch(); 202 | utils.setLoadingBox(cc.instantiate(this.loadingBox), this.node); 203 | // window['bulletPool'] = this.bulletPool; 204 | this.initTargetNode(); 205 | } 206 | 207 | start() { 208 | 209 | // 设置 onshow 监听 210 | WeChat.onShow = res => { 211 | 212 | } 213 | 214 | // 设置 onhide 监听 215 | WeChat.onHide = () => { 216 | 217 | } 218 | } 219 | 220 | update(dt: number) { 221 | if (!this.ball) return; 222 | this.value -= 1 * this.speed; 223 | this.ball.y += this.value * this.speed; 224 | if (this.ball.y <= -500) { 225 | this.ball.y = -500; 226 | this.value = 30; 227 | } 228 | // 自定义的圆角遮罩,只在 onEnable 时更新视图,这里每一帧都变化,所以要重绘 229 | this.ball.getComponent('TheRectMask').drawRadius(); 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /client/assets/Script/Game/Main.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3683906e-e5af-47c0-bed3-435c797da280", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Game/TrackFollow.ts: -------------------------------------------------------------------------------- 1 | import Global from "../Global"; 2 | 3 | const { ccclass, property, menu } = cc._decorator; 4 | 5 | @ccclass() 6 | @menu("Game/轨道式追踪目标") 7 | export default class TrackFollow extends cc.Component { 8 | 9 | /** 移动速度 */ 10 | @property({ displayName: "移动速度" }) 11 | protected speed: number = 2.5; 12 | 13 | /** 跟踪对象 */ 14 | protected target: cc.Node = null; 15 | 16 | /** 终点距离 */ 17 | private endDistance: number = 0; 18 | 19 | /** 初始化 */ 20 | private init() { 21 | this.target = Global.Game.targetNode; 22 | const targetDistance = Math.min(this.target.width * this.target.anchorX, this.target.height * this.target.anchorY); 23 | const selfDistance = this.node.height * this.node.anchorY; 24 | // console.log(targetDistance, selfDistance); 25 | this.endDistance = targetDistance + selfDistance; 26 | } 27 | 28 | /** 跟踪导弹计算移动以及转向角度 */ 29 | private followTarget() { 30 | const targetPosition = this.target.position; // 这里的目标坐标必须要和当前节点同一层父节点,否则要转换到相对坐标 31 | const point = cc.v2(this.node.x, this.node.y); 32 | const delta = targetPosition.sub(point); 33 | const distance = point.sub(targetPosition).mag(); 34 | const x2 = point.x + this.speed * delta.x / distance; 35 | const y2 = point.y + this.speed * delta.y / distance; 36 | const newPosition = cc.v2(x2, y2); 37 | const x1 = point.x; 38 | const y1 = point.y; 39 | const deltaRotation = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90; 40 | this.node.angle = deltaRotation; 41 | 42 | if (distance <= this.endDistance) { 43 | // console.log("到达目标"); 44 | return; 45 | } 46 | this.node.setPosition(newPosition); 47 | } 48 | 49 | // LIFE-CYCLE CALLBACKS: 50 | 51 | start() { 52 | this.init(); 53 | } 54 | 55 | update(dt: number) { 56 | this.followTarget(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /client/assets/Script/Game/TrackFollow.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ce43d8e9-e451-416e-9c7c-4dbe809520e5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Game/VortexFollow.ts: -------------------------------------------------------------------------------- 1 | const {ccclass, property, menu} = cc._decorator; 2 | 3 | @ccclass() 4 | @menu("Game/旋涡式移动到指定目标") 5 | export default class VortexFollw extends cc.Component { 6 | 7 | /** 指定目标 */ 8 | @property({ type: cc.Node, displayName: "指定目标"}) 9 | protected target: cc.Node = null; 10 | 11 | @property({ displayName: "速度值" }) 12 | private speed: number = 0.02; 13 | 14 | /** 角度 */ 15 | private angle = 0; 16 | 17 | /** 向量距离 */ 18 | private distance = 0; 19 | 20 | private stop = false; 21 | 22 | private init() { 23 | this.stop = false; 24 | this.angle = 0; 25 | this.distance = (this.target.position.sub(this.node.position)).mag(); 26 | } 27 | 28 | private move() { 29 | this.angle += 5; 30 | this.distance = cc.misc.lerp(this.distance, 0, this.speed); 31 | const x = (this.target.position.x + this.distance * Math.sin(this.angle * Math.PI / 180)) >> 0; 32 | const y = (this.target.position.y + this.distance * Math.cos(this.angle * Math.PI / 180)) >> 0; 33 | this.node.position = cc.v2(x, y); 34 | if (this.distance < 1) { 35 | this.stop = true; 36 | } 37 | } 38 | 39 | // LIFE-CYCLE CALLBACKS: 40 | 41 | // onLoad () {} 42 | 43 | start() { 44 | this.init(); 45 | } 46 | 47 | update(dt: number) { 48 | if (this.stop) return; 49 | this.move(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /client/assets/Script/Game/VortexFollow.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "5862895c-1a27-4324-8a88-b6df19ee138d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Global.ts: -------------------------------------------------------------------------------- 1 | import Main from "./Game/Main"; 2 | 3 | // class GlobalModule { 4 | // private constructor() { 5 | // console.log('全局对象 >> 单例'); 6 | // } 7 | // public static get instance() { 8 | // if (!this._instance) { 9 | // this._instance = new GlobalModule(); 10 | // } 11 | // return this._instance; 12 | // } 13 | // private static _instance: GlobalModule = null; 14 | // /** 游戏主程序 */ 15 | // public Game: Main; 16 | // /** 游戏数据 */ 17 | // public gameInfo = { 18 | // /** 游戏分数 */ 19 | // score: 0, 20 | // /** 用户授权状态 */ 21 | // authorization: false 22 | // } 23 | // /** 用户数据 */ 24 | // public userData = { 25 | 26 | // } 27 | // /** 游戏设置 */ 28 | // public config = { 29 | 30 | // } 31 | // /** api上传数据 */ 32 | // public uploadInfo = { 33 | // __userInfo: {}, 34 | // __rankInfo: {}, 35 | // dataKey: null 36 | // } 37 | // /** 保存数据 */ 38 | // saveData() { 39 | // window.localStorage.setItem('name', JSON.stringify(this.userData)); 40 | // } 41 | // /** 获取数据 */ 42 | // fetchData() { 43 | // let data: any = window.localStorage.getItem('name') ? JSON.parse(window.localStorage.getItem('name')) : null; 44 | // return data; 45 | // } 46 | // /** 清除本地数据 */ 47 | // removeData() { 48 | // window.localStorage.clear(); 49 | // } 50 | // } 51 | // /** 全局模块 */ 52 | // const Global = GlobalModule.instance; 53 | 54 | class GlobalModule { 55 | constructor() { 56 | console.log('全局对象 >> 类'); 57 | } 58 | 59 | /** 游戏主程序 */ 60 | public Game: Main; 61 | 62 | /** 游戏数据 */ 63 | public gameInfo = { 64 | /** 游戏分数 */ 65 | score: 0, 66 | /** 用户授权状态 */ 67 | authorization: false 68 | } 69 | 70 | /** 音效管理 */ 71 | public musicSystem = { 72 | /** 背景音效 */ 73 | bg: true, 74 | /** 点击音效 */ 75 | click: true 76 | } 77 | 78 | /** 用户数据 */ 79 | public userData = { 80 | 81 | } 82 | 83 | /** 游戏设置 */ 84 | public config = { 85 | 86 | } 87 | 88 | /** api上传数据 */ 89 | public uploadInfo = { 90 | __userInfo: {}, 91 | __rankInfo: {}, 92 | dataKey: null 93 | } 94 | 95 | /** 保存数据 */ 96 | public saveData() { 97 | window.localStorage.setItem('name', JSON.stringify(this.userData)); 98 | } 99 | 100 | /** 获取数据 */ 101 | public fetchData() { 102 | let data: any = window.localStorage.getItem('name') ? JSON.parse(window.localStorage.getItem('name')) : null; 103 | return data; 104 | } 105 | 106 | /** 清除本地数据 */ 107 | public removeData() { 108 | window.localStorage.clear(); 109 | } 110 | } 111 | 112 | /** 全局模块 */ 113 | const Global = new GlobalModule(); 114 | 115 | export default Global; -------------------------------------------------------------------------------- /client/assets/Script/Global.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "5487f68c-1b6d-498e-a4e7-2fa59f8fe068", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Load.ts: -------------------------------------------------------------------------------- 1 | import Global from "./Modules/Global"; 2 | import WeChat from "./Modules/wechat"; 3 | 4 | const { ccclass, property } = cc._decorator; 5 | 6 | @ccclass() 7 | export default class Load extends cc.Component { 8 | 9 | /** 加载文字 */ 10 | @property({ 11 | type: cc.Label, 12 | displayName: '加载文字' 13 | }) 14 | private text: cc.Label = null; 15 | 16 | /** 加载进度条 */ 17 | @property({ 18 | type: cc.Node, 19 | displayName: '加载进度条' 20 | }) 21 | private line: cc.Node = null; 22 | 23 | // LIFE-CYCLE CALLBACKS: 24 | 25 | // onLoad () {} 26 | 27 | start() { 28 | Global.config = { 29 | is_share: 1 30 | } 31 | /** 进度条总宽度 */ 32 | const W: number = this.line.width; 33 | /** 跳转的场景 */ 34 | const NAME: string = 'Game'; 35 | // 设置进度条宽度 36 | this.line.width = 0; 37 | /** 是否拿取到数据 */ 38 | let isFetch: boolean = false; 39 | /** 是否加载完成或者登录完成 */ 40 | let loadCompleted: boolean = false; 41 | /** 是否请求完成 */ 42 | let requestCompleted: boolean = false; 43 | // 从本地拿取数据 44 | if (Global.fetchData()) { 45 | isFetch = true; 46 | Global.userData = Global.fetchData(); 47 | console.log('从本地拿取数据 >>', Global.userData); 48 | } 49 | 50 | /**进入游戏 */ 51 | function openGame() { 52 | requestCompleted = true; 53 | if (loadCompleted) { 54 | WeChat.hideLoading(); 55 | cc.director.loadScene(NAME); 56 | } 57 | } 58 | 59 | if (window['wx']) { 60 | WeChat.userLogin(() => { 61 | WeChat.getData(ret => { 62 | // 这里判断,如果没有从本地拿取数据,那就从服务器上拿取数据 63 | if (ret.data.dataKey && !isFetch) { 64 | Global.userData = ret.data.dataKey; 65 | console.log('本地没有数据,从服务端获取 >>', ret.data.dataKey); 66 | } 67 | 68 | // 判断是否授权 69 | if (ret.data.__userInfo.nickname && ret.data.__userInfo.headimgurl) { 70 | Global.gameInfo.authorization = true; 71 | Global.uploadInfo.__userInfo = ret.data.__userInfo; 72 | } 73 | console.log('用户是否授权-authorization >>', Global.gameInfo.authorization); 74 | 75 | }, function () { 76 | 77 | console.log('获取用户数据失败!!!!'); 78 | 79 | }, () => { 80 | WeChat.getSetting(SET_RES => { 81 | Global.config = SET_RES.data; 82 | console.log('游戏设置 >>', Global.config); 83 | window['setData'] = SET_RES.data; 84 | openGame(); 85 | }, err => { 86 | openGame(); 87 | }); 88 | }); 89 | }, () => { 90 | openGame(); 91 | }); 92 | 93 | // 这里初始化微信控件 94 | WeChat.initShare(); 95 | WeChat.initBanner(); 96 | WeChat.checkVideo(); 97 | } 98 | 99 | cc.director.preloadScene(NAME, (count, total, item) => { 100 | // console.log(count, total); 101 | let val = count / total; 102 | // console.log(val); 103 | this.line.width = W * val; 104 | this.text.string = `加载中...(${Math.floor(val * 100)}%)`; 105 | if (val == 1) this.text.string = `完成(100%)`; 106 | }, () => { 107 | cc.log('预加载游戏场景成功'); 108 | cc.director.loadScene(NAME); 109 | loadCompleted = true; 110 | 111 | // if (requestCompleted) { 112 | // cc.director.loadScene(NAME); 113 | // } else { 114 | // WeChat.showLoading('登录中'); 115 | // } 116 | }); 117 | } 118 | 119 | // update (dt) {} 120 | } 121 | -------------------------------------------------------------------------------- /client/assets/Script/Load.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "53f54cb0-e459-407b-8dfe-4e0ea82dafd9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c9c96a55-c74e-4d08-8371-07a5bd446463", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wechat.ts: -------------------------------------------------------------------------------- 1 | import wxcontrol from "./wxcontrol"; 2 | 3 | /** 微信组件 */ 4 | class WeChatModule extends wxcontrol { 5 | constructor() { 6 | super(); 7 | } 8 | } 9 | 10 | /** 微信模块 */ 11 | const WeChat = new WeChatModule(); 12 | 13 | export default WeChat; 14 | 15 | -------------------------------------------------------------------------------- /client/assets/Script/Modules/wechat.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f0423229-5128-41e1-8274-68a697bcf832", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxcontrol.ts: -------------------------------------------------------------------------------- 1 | import { OptionsShowVideo } from "../utils/interface"; 2 | import wxnetwork from "./wxnetwork"; 3 | 4 | /** 微信控件 */ 5 | export default class wxcontrol extends wxnetwork { 6 | constructor() { 7 | super(); 8 | } 9 | /** wx.getSystemInfoSync */ 10 | public system = window["wx"] ? wx.getSystemInfoSync() : {}; 11 | /** 分享次数 计数 */ 12 | private shareCount = 1; 13 | /** 是否开始分享 防止用户切换后台再回来执行分享判断 */ 14 | private startShare = false; 15 | /** 拉起分享的时间 */ 16 | private before = new Date(); 17 | /** banner控件 */ 18 | private bannerAd = null; 19 | /** banner`id` */ 20 | private readonly bannerID: string = null; 21 | /** 视频控件 */ 22 | private videoAd = null; 23 | /** 视频`id` */ 24 | private readonly videoID: string = null; 25 | /** 是否可以看视频 */ 26 | private hasVideo = true; 27 | /** 视频加载状态 */ 28 | private videoLoading = false; 29 | /** 看视频总共数 */ 30 | public videoTotal = 0; 31 | 32 | /** 33 | * 对比版本 34 | * @param version 对比的版本 35 | * result: -1 => 小于对比版本 0 => 等于对比版本 1 => 大于对比版本 36 | */ 37 | public compareVersion(version: string): number { 38 | /** 当前版本号 */ 39 | let v1 = this.system["SDKVersion"].split("."); 40 | let v2 = version.split("."); 41 | const len = Math.max(v1.length, v2.length); 42 | while (v1.length < len) { 43 | v1.push("0"); 44 | } 45 | while (v2.length < len) { 46 | v2.push("0"); 47 | } 48 | for (let i = 0; i < len; i++) { 49 | const num1 = Math.floor(Number(v1[i])); 50 | const num2 = Math.floor(Number(v2[i])); 51 | if (num1 > num2) { 52 | return 1; 53 | } else if (num1 < num2) { 54 | return -1; 55 | } 56 | } 57 | return 0; 58 | } 59 | 60 | /** 获取分享信息 */ 61 | private getShareInfo(): object { 62 | let num: number = 0; 63 | if (this.config.share_info.length) { 64 | num = Math.floor(Math.random() * this.config.share_info.length); 65 | } 66 | return { 67 | title: this.config.share_info[num].title, 68 | imageUrl: this.config.share_info[num].images, 69 | query: "inviter_id=" + this.userInfo.inviter_id + "&share_img_id=" + this.config.share_info[num].id 70 | } 71 | } 72 | 73 | /** 获取两个时间段的秒数 分享回调用 */ 74 | private getSecond(): number { 75 | let second = (new Date().getTime() - this.before.getTime()) / 1000; 76 | return Math.floor(second); 77 | } 78 | 79 | /** 80 | * 主动拉起分享 81 | * @param reward 分享奖励 不传则直接分享 82 | */ 83 | public share(reward?: Function) { 84 | if (!window["wx"]) return; 85 | this.before = new Date(); 86 | if (reward) { 87 | this.startShare = true; 88 | this.successReward = reward; 89 | } else { 90 | this.startShare = false; 91 | this.successReward = () => { } 92 | } 93 | wx.shareAppMessage(this.getShareInfo()); 94 | } 95 | 96 | /** 初始化分享 只需要执行一次 */ 97 | public initShare() { 98 | if (window["wx"]) { 99 | wx.showShareMenu(); 100 | wx.onShareAppMessage(() => this.getShareInfo()); 101 | wx.onShow(res => { 102 | this.onShow(res); 103 | if (this.startShare) { 104 | this.shareCallback(() => { 105 | this.startShare = false; 106 | this.successReward(); 107 | }, () => { 108 | this.startShare = false; 109 | }); 110 | } 111 | }); 112 | wx.onHide(() => { 113 | this.onHide(); 114 | }); 115 | } 116 | } 117 | 118 | /** 119 | * 判断是否可以分享 120 | * @param key 对应功能规则 key 121 | */ 122 | public isShare(key: string): boolean { 123 | // 这边规则自己定义========================================================================= 124 | /** 是否可以分享 */ 125 | let is_share = !this.hasVideo; 126 | 127 | return is_share; 128 | } 129 | 130 | /** 131 | * 获取奖励 => 该函数判断分享还是看视频 132 | * @param success 分享奖励 133 | * @param key 对应功能规则 key 134 | */ 135 | public getReward(success?: () => void, key?: string) { 136 | // 审核状态判断 137 | if (this.config.is_share == 0 || !this.hasVideo) { 138 | if (success) success(); 139 | return; 140 | } 141 | // 这里执行分享还是看视频 142 | if (this.isShare(key)) { 143 | this.share(success); 144 | } else { 145 | this.showVideo({ 146 | success 147 | }); 148 | } 149 | } 150 | 151 | /** 成功领取奖励 */ 152 | private successReward: Function = function () { }; 153 | 154 | /** 微信 onshow 不定义就不监听 */ 155 | public onShow: (res: any) => void = function(res) { } 156 | 157 | /** 微信 onhide 不定义就不监听 */ 158 | public onHide: Function = function () { } 159 | 160 | /** 161 | * 微信分享回调 162 | * @param success 成功回调 163 | * @param fail 失败回调 164 | */ 165 | private shareCallback(success: Function, fail: Function) { 166 | const THAT = this; 167 | let text = ["分享失败文案一", "分享失败文案二", "分享失败文案三"]; 168 | let textIndex = Math.floor(3 * Math.random()); 169 | let confirmText = "再次点击分享"; 170 | 171 | // 判断分享时间 or 分享取消 172 | if (THAT.getSecond() < THAT.config.share_time) { 173 | THAT.showConfirm(text[textIndex], "系统提示:", function () { 174 | THAT.share(THAT.successReward); 175 | }, function () { 176 | if (fail) fail(); 177 | }, confirmText); 178 | return; 179 | } 180 | 181 | /** 几率范围 */ 182 | let range = Math.floor(100 * Math.random()) + 1; 183 | 184 | switch (THAT.shareCount) { 185 | case 1: 186 | if (range <= 1) { 187 | if (success) success(); 188 | } else { 189 | THAT.showConfirm(text[textIndex], "系统提示:", function () { 190 | THAT.share(THAT.successReward); 191 | }, function () { 192 | if (fail) fail(); 193 | }, confirmText); 194 | } 195 | break; 196 | case 2: 197 | if (range <= 70) { 198 | if (success) success(); 199 | } else { 200 | THAT.showConfirm(text[textIndex], "系统提示:", function () { 201 | THAT.share(THAT.successReward); 202 | }, function () { 203 | if (fail) fail(); 204 | }, confirmText); 205 | } 206 | break; 207 | case 3: 208 | if (range <= 60) { 209 | if (success) success(); 210 | } else { 211 | THAT.showConfirm(text[textIndex], "系统提示:", function () { 212 | THAT.share(THAT.successReward); 213 | }, function () { 214 | if (fail) fail(); 215 | }, confirmText); 216 | } 217 | break; 218 | case 4: 219 | if (success) success(); 220 | break; 221 | } 222 | this.shareCount += 1; 223 | if (this.shareCount > 4) this.shareCount = 1; 224 | } 225 | 226 | /** 初始化banner */ 227 | public initBanner() { 228 | if (window["wx"] && this.compareVersion("2.0.4") >= 0 && this.bannerID) { 229 | this.bannerAd = wx.createBannerAd({ 230 | adUnitId: this.bannerID, 231 | style: { 232 | left: 0, 233 | top: 0, 234 | width: this.system["windowWidth"] 235 | } 236 | }); 237 | this.bannerAd.onResize(res => { 238 | // console.log("广告尺寸", res); 239 | this.bannerAd.style.top = this.system["windowHeight"] - Math.floor(res.height); 240 | }); 241 | this.bannerAd.onError(err => { 242 | console.log("init Banner fail !!!", err); 243 | }); 244 | this.bannerAd.hide(); 245 | } 246 | } 247 | 248 | /** 显示banner */ 249 | public showBanner() { 250 | if (this.bannerAd) { 251 | this.bannerAd.show(); 252 | } 253 | } 254 | 255 | /** 隐藏banner */ 256 | public hideBanner() { 257 | if (this.bannerAd) { 258 | this.bannerAd.hide(); 259 | } 260 | } 261 | 262 | /** 检测有无视频播放 只需要初始化执行一次 */ 263 | public checkVideo() { 264 | if (this.compareVersion("2.0.4") < 0 || !this.videoID) { 265 | this.hasVideo = false; 266 | return; 267 | } 268 | // 首次初始化视频 269 | this.videoAd = wx.createRewardedVideoAd({ 270 | adUnitId: this.videoID, 271 | }); 272 | // 检测有无视频 273 | this.videoAd.onError((error: any) => { 274 | console.log("检测有无视频 >>", error); 275 | this.hasVideo = false; 276 | }); 277 | } 278 | 279 | /** 280 | * 拉起视频 281 | * @param reward 领取奖励 function() 282 | */ 283 | public showVideo(options: OptionsShowVideo) { 284 | if (this.videoLoading) return this.showToast("视频载入中"); 285 | this.videoLoading = true; 286 | const THAT = this; 287 | /** 视频组件 */ 288 | let videoAd = wx.createRewardedVideoAd({ "adUnitId": (options.videoId || this.videoID) }); 289 | /** 销毁视频组件 */ 290 | function destroyVideoAd() { 291 | if (videoAd) { 292 | // 这里要取消监听 293 | videoAd.offClose(closeCallback); 294 | videoAd.destroy(); 295 | videoAd = null; 296 | } 297 | } 298 | /** 299 | * 关闭回调 300 | * @param res 301 | */ 302 | function closeCallback(res: { isEnded: boolean }) { 303 | destroyVideoAd(); 304 | if (res && res.isEnded) { 305 | THAT.videoLoading = false; 306 | options.success && options.success(); 307 | } else { 308 | THAT.videoLoading = false; 309 | THAT.showToast("你提前关闭了视频"); 310 | } 311 | } 312 | // videoAd.onLoad(() => {}); 313 | videoAd.load().then(() => { 314 | videoAd.show(); 315 | }).catch(err => { 316 | console.log("视频错误 !!! catch >>", err); 317 | destroyVideoAd(); 318 | options.fail && options.fail(err); 319 | }); 320 | videoAd.onError(err => { 321 | console.log("视频错误 !!! onError >>", err); 322 | destroyVideoAd(); 323 | options.fail && options.fail(err); 324 | }); 325 | videoAd.onClose(closeCallback); 326 | } 327 | 328 | /** 打开客服会话 */ 329 | public openService() { 330 | const THAT = this; 331 | if (window["wx"]) { 332 | if (this.compareVersion("2.0.3") < 0) return this.showAlert("当前微信版本过低,无法使用客服功能"); 333 | wx.openCustomerServiceConversation({ 334 | success() { 335 | // showAlert("打开客服对话成功"); 336 | }, 337 | fail() { 338 | // showAlert("打开客服对话失败"); 339 | THAT.showToast("打开客服对话失败"); 340 | }, 341 | }); 342 | } 343 | } 344 | 345 | /** 346 | * 游戏跳转 347 | * @param data 跳转 icon 数据 348 | * @param success 成功回调 349 | * @param fail 失败回调 350 | */ 351 | public openMiniGame(data: object, success?: Function, fail?: Function) { 352 | const THAT = this; 353 | // 直跳 354 | if (this.compareVersion("2.2.0") >= 0 && data["navigate_type"] == 1) { 355 | wx.navigateToMiniProgram({ 356 | appId: data["appid"], 357 | path: data["path"], 358 | success() { 359 | if (success) success(); 360 | }, 361 | fail() { 362 | if (fail) fail(); 363 | THAT.showAlert("跳转失败"); 364 | }, 365 | }); 366 | } 367 | // 扫码 368 | else { 369 | let src = data["poster"]; 370 | wx.previewImage({ 371 | current: src, 372 | urls: [src], 373 | success() { 374 | if (success) success(); 375 | }, 376 | fail() { 377 | if (fail) fail(); 378 | THAT.showAlert("跳转失败"); 379 | } 380 | }); 381 | } 382 | } 383 | 384 | /** 检测是否需要更新版本 */ 385 | public checkVersionUpdate() { 386 | if (this.compareVersion("1.9.90") >= 0) { 387 | const updateManager = wx.getUpdateManager(); 388 | updateManager.onCheckForUpdate(res => { 389 | // 请求完新版本信息的回调 390 | console.log("请求完新版本信息的回调 >>", res.hasUpdate); 391 | }); 392 | updateManager.onUpdateReady(() => { 393 | this.showConfirm("新版本已经准备好,是否重启应用?", "更新提示", () => { 394 | updateManager.applyUpdate(); 395 | }); 396 | }); 397 | updateManager.onUpdateFailed(() => { 398 | this.showAlert("版本更新下载失败"); 399 | }); 400 | } 401 | } 402 | 403 | /** 设置屏幕常亮 */ 404 | public setKeepLight() { 405 | if (this.compareVersion("1.4.0") >= 0) { 406 | wx.setKeepScreenOn({ 407 | keepScreenOn: true 408 | }); 409 | } 410 | } 411 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxcontrol.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "8b7127b2-b519-4b71-80e0-b0ae1dbc6b42", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxnetwork.ts: -------------------------------------------------------------------------------- 1 | import wxutils from "./wxutils"; 2 | 3 | /** 微信网络接口类 */ 4 | export default class wxnetwork extends wxutils { 5 | constructor() { 6 | super(); 7 | } 8 | /** 域名 */ 9 | private readonly baseUrl = "https://xxx.com/name"; 10 | /** 用户信息 */ 11 | public userInfo = { 12 | openid: "", 13 | session_key: "", 14 | head_cookie: "", 15 | inviter_id: "", 16 | nickname: "", 17 | headimgurl: "" 18 | } 19 | /** 获取游戏设置信息 */ 20 | public config = { box_info: [], is_share: 1, share_time: 1, share_info: [] } 21 | /** 登录次数计数 */ 22 | private login_count = 0; 23 | /** 最大登录次数 */ 24 | private max_count = 3; 25 | 26 | /** 27 | * 公用请求 28 | * @param method POST or GET 29 | * @param url 接口连接 30 | * @param data 数据 31 | * @param success 成功回调 32 | * @param fail 失败回调 33 | */ 34 | private baseRequest(method: string, url: string, data: string | object, success: Function, fail: Function) { 35 | wx.request({ 36 | url: this.baseUrl + url, 37 | method: method, 38 | header: { 39 | "content-type": "application/json", 40 | "cookie": this.userInfo.head_cookie, 41 | "version": "1.0.0" 42 | }, 43 | data: data, 44 | success(res) { 45 | if (res.data.code == 200) { 46 | if (success) success(res.data, res.header); 47 | } else { 48 | if (fail) fail(res); 49 | } 50 | }, 51 | fail() { 52 | if (fail) fail("登录失败"); 53 | } 54 | }); 55 | } 56 | 57 | /** 58 | * 用户登录 获取 openID 和 session_key 59 | * @param success 成功回调 60 | * @param fail 失败回调 61 | */ 62 | public userLogin(success?: Function, fail?: Function) { 63 | const THAT = this; 64 | /** 启动参数 */ 65 | let luach = wx.getLaunchOptionsSync(); 66 | /** 失败再次请求 */ 67 | function loginAgain() { 68 | setTimeout(function() { 69 | if (THAT.login_count >= THAT.max_count) { 70 | if (fail) fail(); 71 | } else { 72 | THAT.userLogin(success, fail); 73 | THAT.showToast("重新登录中,马上就好"); 74 | console.log("login_fail ===============> count: ", THAT.login_count); 75 | THAT.login_count += 1; 76 | } 77 | }, 300); 78 | } 79 | wx.login({ 80 | success(wxres) { 81 | let _data = { 82 | code: wxres.code, 83 | inviter_id: luach.query.inviter_id ? luach.query.inviter_id : "" 84 | } 85 | THAT.baseRequest("POST", "/user/login", _data, (res: any, header: any) => { 86 | if (res.code == 200) { 87 | THAT.userInfo.openid = res.data.openid; 88 | THAT.userInfo.session_key = res.data.session_key; 89 | THAT.userInfo.inviter_id = res.data.id; 90 | THAT.userInfo.nickname = res.data.nickname; 91 | THAT.userInfo.headimgurl = res.data.headimgurl; 92 | THAT.userInfo.head_cookie = header["Set-Cookie"]; 93 | if (success) success(res); 94 | } else { 95 | loginAgain(); 96 | } 97 | }, err => { 98 | loginAgain(); 99 | }); 100 | }, 101 | fail() { 102 | loginAgain(); 103 | } 104 | }); 105 | } 106 | 107 | /** 108 | * 获取游戏设置 109 | * @param success 成功回调 110 | * @param fail 失败回调 111 | * @param complete 完成回调 112 | */ 113 | public getSetting(success: Function, fail?: Function, complete?: Function) { 114 | this.baseRequest("GET", "/setting/config", {}, res => { 115 | this.config = res.data; 116 | // console.log("设置游戏数据成功", res.data); 117 | if (success) success(res); 118 | if (complete) complete(); 119 | }, err => { 120 | // console.log("设置游戏数据失败!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); 121 | this.showToast("设置游戏数据失败"); 122 | if (fail) fail(err); 123 | if (complete) complete(); 124 | }); 125 | } 126 | 127 | /** 128 | * 上传数据 129 | * @param data 上传数据 130 | * @param success 成功回调 131 | * @param fail 失败回调 132 | */ 133 | public saveData(data: any, success: Function, fail?: Function) { 134 | this.baseRequest("POST", "/user/setData", data, res => { 135 | if (res.code == 200) { 136 | if (success) success(res); 137 | } else { 138 | if (fail) fail(res); 139 | console.log("上传数据失败!!!!!!!!!!!!!!!!!!!!!!!!!!!!", res); 140 | } 141 | }, err => { 142 | if (fail) fail(err); 143 | console.log("上传数据失败!!!!!!!!!!!!!!!!!!!!!!!!!!!!", err); 144 | }); 145 | } 146 | 147 | /** 148 | * 获取用户数据 149 | * @param success 成功回调 150 | * @param fail 失败回调 151 | * @param complete 完成回调 152 | */ 153 | public getData(success: Function, fail?: Function, complete?: Function) { 154 | this.baseRequest("GET", "/user/getData", {}, res => { 155 | if (res.code == 200) { 156 | if (success) success(res); 157 | if (complete) complete(); 158 | } else { 159 | if (fail) fail(res); 160 | if (complete) complete(); 161 | this.showToast("获取用户数据失败"); 162 | } 163 | }, err => { 164 | if (fail) fail(err); 165 | if (complete) complete(); 166 | this.showToast("获取用户数据失败"); 167 | }); 168 | } 169 | 170 | /** 171 | * 获取排行榜 172 | * @param success 成功回调 173 | * @param fail 失败回调 174 | */ 175 | public getRank(success: Function, fail?: Function) { 176 | this.baseRequest("GET", "/rank/world", {}, res => { 177 | if (res.code == 200) { 178 | if (success) success(res); 179 | } else { 180 | if (fail) fail(res); 181 | this.showAlert("获取世界排行榜失败") 182 | } 183 | }, err => { 184 | if (fail) fail(err); 185 | this.showAlert("获取世界排行榜失败") 186 | }); 187 | } 188 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxnetwork.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3acb4d3a-4838-4cc9-a3ca-5d61309620aa", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxutils.ts: -------------------------------------------------------------------------------- 1 | /** 微信工具类 */ 2 | export default class wxutils { 3 | /** 4 | * 显示 loading 5 | * @param title 显示文字 6 | */ 7 | public showLoading(title: string = "加载中") { 8 | if (window["wx"]) { 9 | wx.showLoading({ 10 | title: title, 11 | mask: true, 12 | }); 13 | } 14 | } 15 | 16 | /** 隐藏 loading */ 17 | public hideLoading() { 18 | if (window["wx"]) wx.hideLoading(); 19 | } 20 | 21 | /** 22 | * 显示 toast 23 | * @param title 提示文字 24 | * @param icon type: "success", "loading", "none" 25 | * @param time 时间 26 | */ 27 | public showToast(title: string = "提示", icon: any = "none", time: number = 2000) { 28 | if (window["wx"]) { 29 | wx.showToast({ 30 | title: title, 31 | icon: icon, 32 | duration: time 33 | }); 34 | } else { 35 | alert(title); 36 | } 37 | } 38 | 39 | /** 40 | * 提示框 41 | * @param content 内容 42 | * @param title 标题 43 | * @param callback 确认回调 44 | */ 45 | public showAlert(content: string, title: string = "提示", callback?: Function) { 46 | if (window["wx"]) { 47 | wx.showModal({ 48 | title: title, 49 | content: content, 50 | showCancel: false, 51 | success(res) { 52 | if (callback) callback(res); 53 | } 54 | }); 55 | } 56 | } 57 | 58 | /** 59 | * 确认弹窗 60 | * @param content 内容 61 | * @param title 标题 62 | * @param callback 确认回调 63 | * @param cancel 取消回调 64 | * @param text 确认文字 65 | */ 66 | public showConfirm(content: string, title: string = "确认提醒", callback?: Function, cancel?: Function, text: string = "确认") { 67 | if (window["wx"]) { 68 | wx.showModal({ 69 | title: title, 70 | content: content, 71 | showCancel: true, 72 | confirmText: text, 73 | success(res) { 74 | if (res.confirm) { 75 | if (callback) callback(); 76 | } else if (res.cancel) { 77 | if (cancel) cancel(); 78 | } 79 | }, 80 | }); 81 | } 82 | } 83 | 84 | /** 85 | * 获取用户授权信息 86 | * @param successCB 授权成功 87 | * @param failCB 授权失败 88 | * @param style 样式 89 | * loginInfo => 登录信息 90 | * res => 用户信息 91 | */ 92 | checkLogin(successCB: Function, failCB: Function, style: any) { 93 | const THAT = this; 94 | wx.login({ 95 | success(loginInfo) { 96 | wx.getUserInfo({ 97 | success(res: any) { 98 | res.code = loginInfo.code; 99 | if (successCB) successCB(res); 100 | }, 101 | fail() { 102 | console.log("创建获取用户信息按钮"); 103 | // 创建获取用户信息按钮 104 | let loginBtn = wx.createUserInfoButton({ 105 | type: "text", 106 | text: "", 107 | style: style, 108 | }); 109 | // 监听点击事件 110 | loginBtn.onTap(res => { 111 | console.log("用户授权数据:", res); 112 | res["code"] = loginInfo.code; 113 | if (res.errMsg != "getUserInfo:ok") return THAT.showAlert("排行榜功能需要授权的哦!"); 114 | if (successCB) successCB(res); 115 | loginBtn.destroy(); 116 | }); 117 | } 118 | }); 119 | }, 120 | fail() { 121 | console.log("登录失败=====>"); 122 | if (failCB) failCB(); 123 | }, 124 | }); 125 | } 126 | } -------------------------------------------------------------------------------- /client/assets/Script/Modules/wxutils.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "e0bdea16-6a8a-4a2d-bdea-50b70996a2b6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Popup.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5624ce2f-2d25-4251-a77a-31a67b9416ee", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Script/Popup/Base.ts: -------------------------------------------------------------------------------- 1 | 2 | const {ccclass, property} = cc._decorator; 3 | 4 | /** 弹出层(基类) */ 5 | @ccclass() 6 | export default class Popup extends cc.Component { 7 | 8 | /** 中间弹出层 */ 9 | @property({ type: cc.Node, displayName: "中间弹出层" }) 10 | protected popBox: cc.Node = null; 11 | 12 | /** 旋转光环 */ 13 | @property({ type: cc.Node, displayName: "旋转光环" }) 14 | protected ringNode: cc.Node = null; 15 | 16 | /** 关闭当前组件节点 */ 17 | public close() { 18 | this.node.active = false; 19 | } 20 | 21 | /** 22 | * 出现动画 弹框式 23 | * @param {cc.Node} node 默认是 this.popBox 24 | */ 25 | public showMove(node: cc.Node = null) { 26 | let content = node ? node : this.popBox; 27 | content.stopAllActions(); 28 | content.setScale(0.5); 29 | content.opacity = 0; 30 | let action = cc.spawn(cc.fadeIn(0.15), cc.scaleTo(0.15, 1.1, 1.1)); 31 | action.easing(cc.easeElasticInOut(3.0)); 32 | content.runAction(cc.sequence( 33 | action, 34 | cc.scaleTo(0.1, 1, 1) 35 | )); 36 | } 37 | 38 | /** 39 | * 滑动 出现 40 | * @param {cc.Node} node 滑动的节点 41 | * @param {number} width 滑动的宽度 42 | */ 43 | public slideMove(node: cc.Node, width: number) { 44 | node.stopAllActions(); 45 | node.x = width; 46 | let action = cc.moveTo(0.3, 0, -41); 47 | action.easing(cc.easeElasticInOut(3.0)); 48 | node.runAction(action); 49 | } 50 | 51 | /** 52 | * 光环动画 53 | * @param {cc.Node} node 默认是 this.popBox 54 | */ 55 | public ringMove(node: cc.Node = null) { 56 | let ring = node ? node : this.ringNode; 57 | ring.runAction(cc.repeatForever( 58 | cc.sequence( 59 | cc.spawn(cc.scaleTo(0.5, 1.2), cc.rotateBy(0.5, 36)), 60 | cc.spawn(cc.scaleTo(0.5, 0.9), cc.rotateBy(0.5, 36)), 61 | ) 62 | )) 63 | } 64 | 65 | // LIFE-CYCLE CALLBACKS: 66 | 67 | // onLoad () {} 68 | 69 | // start () {} 70 | 71 | // update (dt) {} 72 | } 73 | -------------------------------------------------------------------------------- /client/assets/Script/Popup/Base.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "31dc00d4-d150-4033-8de5-638c1cf42fd9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/Popup/Rank.ts: -------------------------------------------------------------------------------- 1 | import Popup from "./Base"; 2 | import utils from "../utils"; 3 | 4 | const { ccclass, property, menu } = cc._decorator; 5 | 6 | @ccclass() 7 | @menu("弹出层/排行榜") 8 | export default class Rank extends Popup { 9 | 10 | @property({ type: cc.WXSubContextView, displayName: "子域容器" }) 11 | private subBox: cc.WXSubContextView = null; 12 | 13 | @property({ type: cc.Node, displayName: "世界榜容器" }) 14 | private worldBox: cc.Node = null; 15 | 16 | @property({ displayName: "item数量" }) 17 | private itemNumber: number = 5; 18 | 19 | @property({ type: cc.SpriteFrame, displayName: "奖杯图片" }) 20 | private cupImg: cc.SpriteFrame[] = []; 21 | 22 | /** 页数 */ 23 | private page: number = 0; 24 | 25 | /** 最大页数 */ 26 | private page_max: number = 0; 27 | 28 | /** 排行榜列表 */ 29 | private rank_list: any[] = []; 30 | 31 | /** item容器 */ 32 | private item_box: cc.Node = null; 33 | 34 | /** 页数label */ 35 | private page_label: cc.Label = null; 36 | 37 | /** 暂无数据提示 */ 38 | private none_data: cc.Node = null; 39 | 40 | /** 默认头像 */ 41 | private default_head: cc.SpriteFrame = null; 42 | 43 | /** 关闭按钮 */ 44 | private closeBtn() { 45 | this.rankSwitch(null, "world"); 46 | // 这里要下一帧执行 47 | this.scheduleOnce(() => { 48 | this.close(); 49 | }, 0); 50 | } 51 | 52 | /** 53 | * 世界 - 好友榜切换 54 | * @param {event} e 55 | * @param {string} type 56 | */ 57 | private rankSwitch(e: any, type: string) { 58 | switch (type) { 59 | case "world": 60 | this.worldBox.active = true; 61 | if (window["wx"]) { 62 | wx.postMessage({ 63 | action: "hide", 64 | }); 65 | // 这里要下一帧执行 66 | this.scheduleOnce(() => { 67 | this.subBox.update(); 68 | }, 0); 69 | } 70 | break; 71 | 72 | case "friend": 73 | this.worldBox.active = false; 74 | if (window["wx"]) { 75 | wx.postMessage({ 76 | action: "show", 77 | }); 78 | // 这里要下一帧执行 79 | this.scheduleOnce(() => { 80 | this.subBox.update(); 81 | }, 0); 82 | } 83 | break; 84 | } 85 | } 86 | 87 | /** 下一页 */ 88 | private nextPage() { 89 | if (this.worldBox.active) { 90 | if (this.page >= this.page_max - 1) return; 91 | this.page += 1; 92 | this.updateItem(); 93 | } else { 94 | // 子域切换 95 | if (window["wx"]) { 96 | wx.postMessage({ 97 | action: "next", 98 | }); 99 | // 这里要下一帧执行 100 | this.scheduleOnce(() => { 101 | this.subBox.update(); 102 | }, 0); 103 | } 104 | } 105 | } 106 | 107 | /** 上一页 */ 108 | private previousPage() { 109 | if (this.worldBox.active) { 110 | if (this.page == 0) return; 111 | this.page -= 1; 112 | this.updateItem(); 113 | } else { 114 | // 子域切换 115 | if (window["wx"]) { 116 | wx.postMessage({ 117 | action: "previous", 118 | }); 119 | // 这里要下一帧执行 120 | this.scheduleOnce(() => { 121 | this.subBox.update(); 122 | }, 0); 123 | } 124 | } 125 | } 126 | 127 | /** 更新item */ 128 | private updateItem() { 129 | /** 排行榜列表 */ 130 | let list = this.rank_list; 131 | // 遍历更新 132 | this.item_box.children.forEach((item, i) => { 133 | /** 排名 */ 134 | let index = this.page * this.itemNumber + i; 135 | if (list[index]) { 136 | item.active = true; 137 | /** 排名 */ 138 | let rank = cc.find("rank", item).getComponent(cc.Label); 139 | /** 奖杯 */ 140 | let cup = cc.find("cup", item).getComponent(cc.Sprite); 141 | /** 用户头像 */ 142 | let head = cc.find("head", item).getComponent(cc.Sprite); 143 | /** 用户名 */ 144 | let name = cc.find("name", item).getComponent(cc.Label); 145 | /** 分数 */ 146 | let score = cc.find("score", item).getComponent(cc.Label); 147 | // 排名 148 | if (index < 3) { 149 | cup.node.active = true; 150 | cup.spriteFrame = this.cupImg[index]; 151 | rank.node.active = false; 152 | } else { 153 | cup.node.active = false; 154 | rank.node.active = true; 155 | rank.string = (index + 1).toString(); 156 | } 157 | // 头像 158 | if (list[index].headimgurl) { 159 | utils.loadNetworkImg(head.node, list[index].headimgurl); 160 | } else { 161 | head.spriteFrame = this.default_head; 162 | } 163 | name.string = list[index].nickname; 164 | score.string = list[index].score; 165 | } else { 166 | item.active = false; 167 | } 168 | }); 169 | // 判断有无数据 170 | if (this.rank_list.length == 0) { 171 | this.none_data.active = true; 172 | this.page_label.string = "--/--"; 173 | } else { 174 | this.none_data.active = false; 175 | this.page_label.string = this.page + 1 + "/" + this.page_max; 176 | } 177 | } 178 | 179 | /** 初始化 */ 180 | private init() { 181 | /** item容器 */ 182 | this.item_box = cc.find("content", this.worldBox); 183 | /** 页数label */ 184 | this.page_label = cc.find("page-label", this.worldBox).getComponent(cc.Label); 185 | /** 暂无数据提示 */ 186 | this.none_data = cc.find("tip", this.worldBox); 187 | /** 首个item */ 188 | let item = cc.find("item", this.item_box); 189 | /** item预制体 */ 190 | let prefab = cc.instantiate(item); 191 | /** 默认头像 */ 192 | this.default_head = cc.find("head", item).getComponent(cc.Sprite).spriteFrame; 193 | for (let i = 1; i < this.itemNumber; i++) { 194 | const item = cc.instantiate(prefab); 195 | item.parent = this.item_box; 196 | } 197 | } 198 | 199 | /** 测试列表 */ 200 | private testList() { 201 | let list = []; 202 | for (let i = 0; i < 51; i++) { 203 | list.push({ 204 | openid: "id" + i, 205 | nickname: "用户" + (i + 1), 206 | headimgurl: "", 207 | score: i + Math.floor(100 * Math.random()) 208 | }); 209 | } 210 | // 排序 211 | list.sort((a, b) => b.score - a.score); 212 | return list; 213 | } 214 | 215 | // LIFE-CYCLE CALLBACKS: 216 | 217 | onEnable() { 218 | this.showMove(); 219 | // 接口请求完成后更新item 220 | this.rank_list = this.testList(); 221 | // this.rank_list = []; 222 | // 页数重置为 0 223 | this.page = 0; 224 | // 最大页数 225 | this.page_max = Math.ceil(this.rank_list.length / this.itemNumber); 226 | // console.log("最大页数", this.page_max); 227 | this.updateItem(); 228 | // 更新子域数据 229 | if (window["wx"]) { 230 | wx.postMessage({ 231 | action: "update", 232 | }) 233 | } 234 | } 235 | 236 | onLoad() { 237 | this.init(); 238 | this.subBox.enabled = false; 239 | } 240 | 241 | // update (dt) {} 242 | } 243 | -------------------------------------------------------------------------------- /client/assets/Script/Popup/Rank.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "9706d8cc-99be-4a1c-824e-73c09065de58", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/UI.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8f23f34d-02c1-425c-86a0-1fe8a07ad5fa", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/Script/UI/TheButton.ts: -------------------------------------------------------------------------------- 1 | const { ccclass, property, menu, requireComponent } = cc._decorator; 2 | 3 | /** UI 按钮 */ 4 | @ccclass() 5 | @menu("自定义组件/按钮") 6 | @requireComponent(cc.Button) 7 | export default class TheButton extends cc.Component { 8 | 9 | @property({ displayName: "摁下去缩放值" }) 10 | private touchScale: number = 0.85; 11 | 12 | @property({ displayName: "动画过渡时间" }) 13 | private transDuration: number = 0.1; 14 | 15 | @property({ displayName: "摁下去的透明度" }) 16 | private touchOpacity: number = 255; 17 | 18 | @property({ displayName: "是否需要点击动画" }) 19 | private isClick: boolean = false; 20 | 21 | @property({ displayName: "按下时按钮变灰" }) 22 | private isGray: boolean = false; 23 | 24 | /** 按钮初始透明值 */ 25 | private initOpacity: number = null; 26 | 27 | /** 按钮初始化缩放值 */ 28 | private initScale: number = null; 29 | 30 | /** 点击动画 */ 31 | protected clickMove() { 32 | this.node.stopAllActions(); 33 | let seq = cc.sequence(cc.scaleTo(0.1, 1.1, 1.1), cc.scaleTo(0.1, 0.8, 0.8), cc.scaleTo(0.1, 1.2, 1.2), cc.scaleTo(0.1, 1, 1)); 34 | this.node.runAction(seq); 35 | } 36 | 37 | protected onTouchDown() { 38 | // cc.log("摁下"); 39 | if (this.isGray) { 40 | this.node.color = cc.color(140, 140, 140); 41 | } else { 42 | this.node.stopAllActions(); 43 | this.node.runAction(cc.scaleTo(this.transDuration, this.touchScale)); 44 | this.node.opacity = this.touchOpacity; 45 | } 46 | } 47 | 48 | protected onTouchUp() { 49 | // cc.log("松开"); 50 | if (this.isGray) { 51 | this.node.color = cc.color(255, 255, 255); 52 | } else { 53 | this.node.stopAllActions(); 54 | this.node.runAction(cc.scaleTo(this.transDuration, this.initScale)); 55 | this.node.opacity = this.initOpacity; 56 | } 57 | } 58 | 59 | // LIFE-CYCLE CALLBACKS: 60 | 61 | onLoad() { 62 | if (!this.isClick) { 63 | this.initScale = this.node.scale; 64 | this.initOpacity = this.node.opacity; 65 | // console.log("透明度", this.initOpacity); 66 | this.node.on("touchstart", this.onTouchDown, this); 67 | this.node.on("touchend", this.onTouchUp, this); 68 | this.node.on("touchcancel", this.onTouchUp, this); 69 | } 70 | } 71 | 72 | // start() {} 73 | 74 | // update (dt) {} 75 | } 76 | -------------------------------------------------------------------------------- /client/assets/Script/UI/TheButton.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fff3ab3f-4aa1-4490-8ea3-6a2ed84a5287", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/UI/TheRectMask.ts: -------------------------------------------------------------------------------- 1 | const { ccclass, property, menu, requireComponent, disallowMultiple, executeInEditMode } = cc._decorator; 2 | 3 | cc.macro.ENABLE_WEBGL_ANTIALIAS = true; 4 | 5 | /** UI 矩形圆角遮罩 */ 6 | @ccclass() 7 | @disallowMultiple() 8 | @executeInEditMode() 9 | @requireComponent(cc.Mask) 10 | @menu("自定义组件/矩形圆角遮罩") 11 | export default class TheRectMask extends cc.Component { 12 | 13 | /** 圆角半径 */ 14 | @property({ visible: false }) 15 | private radius: number = 20; 16 | 17 | /** 矩形大小 */ 18 | @property({ visible: false }) 19 | private size: cc.Vec2 = new cc.Vec2(); 20 | 21 | /** 圆角半径 */ 22 | @property({ displayName: "圆角半径" }) 23 | protected get boxRadius(): number { 24 | return this.radius; 25 | } 26 | protected set boxRadius(value: number) { 27 | this.radius = value; 28 | this.drawRadius(); 29 | } 30 | 31 | @property({ displayName: "矩形大小" }) 32 | protected get boxSize(): cc.Vec2 { 33 | return this.size; 34 | } 35 | protected set boxSize(value: cc.Vec2) { 36 | this.size = value; 37 | // 设置容器和图片的大小 38 | this.node.setContentSize(value.x, value.y); 39 | this.image.setContentSize(value.x, value.y); 40 | } 41 | 42 | /** 子节点 image */ 43 | @property({ visible: false }) 44 | private image: cc.Node = null; 45 | 46 | /** 绘制圆角 */ 47 | private drawRadius() { 48 | /** 当前节点尺寸 */ 49 | let size = this.node.getContentSize(); 50 | /** 矩形 */ 51 | let rect = cc.rect(-size.width / 2, -size.height / 2, size.width, size.height); 52 | let graphics = this.getComponent(cc.Mask)["_graphics"]; 53 | this.drawRoundRect(graphics, rect); 54 | } 55 | 56 | /** 57 | * 绘制圆角矩形 58 | * @param graphics 59 | * @param rect 60 | */ 61 | private drawRoundRect(graphics: cc.Graphics, rect: cc.Rect) { 62 | let { x, y, width, height } = rect; 63 | // 清空所有路径 64 | graphics.clear(); 65 | // 线条宽度 66 | graphics.lineWidth = 1; 67 | // 矩形 68 | graphics.roundRect(x, y, width, height, this.radius); 69 | // 填充 70 | graphics.fill(); 71 | // 绘制 72 | graphics.stroke(); 73 | } 74 | 75 | /** 创建 image */ 76 | private createImage() { 77 | if (cc.find("image", this.node)) return; 78 | this.image = new cc.Node("image"); 79 | this.image.parent = this.node; 80 | this.image.addComponent(cc.Sprite); 81 | /** 图片组件 */ 82 | let image_sprite = this.image.getComponent(cc.Sprite); 83 | image_sprite.sizeMode = cc.Sprite.SizeMode.CUSTOM; 84 | } 85 | 86 | // LIFE-CYCLE CALLBACKS: 87 | 88 | onEnable() { 89 | // 这里每次都要重新绘画 90 | this.drawRadius(); 91 | } 92 | 93 | start() { 94 | // 这里写在onload里面不生效 95 | this.createImage(); 96 | // console.log(this.size, this.radius); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /client/assets/Script/UI/TheRectMask.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "2f288e79-af26-4c6c-9b27-0f62441bb303", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /client/assets/Script/utils/CCutils.ts: -------------------------------------------------------------------------------- 1 | export default class ModuleCCutils { 2 | /** 加载框 */ 3 | private loading_box: cc.Node; 4 | /** 加载进度文字 */ 5 | private loading_text: cc.Label; 6 | 7 | /** 8 | * 返回旋转角度 旋转的节点坐标必须为(0, 0)才可以 所以要相对应的进行转换 9 | * @param x 目标坐标 x 10 | * @param y 目标坐标 y 11 | */ 12 | public rotateAngle(x: number, y: number) { 13 | if (y === 0) { 14 | if (x > 0) { 15 | return 90; 16 | } 17 | else if (x < 0) { 18 | return 270; 19 | } 20 | return 0; 21 | } 22 | if (x === 0) { 23 | if (y > 0) { 24 | return 0; 25 | } 26 | else { 27 | return 180; 28 | } 29 | } 30 | 31 | let rate = Math.atan(Math.abs(x) / Math.abs(y)); 32 | if (x > 0 && y > 0) { 33 | return 360 - 180 * rate / Math.PI; 34 | } else if (x > 0 && y < 0) { 35 | return 180 + 180 * rate / Math.PI; 36 | } else if (x < 0 && y < 0) { 37 | return 180 - 180 * rate / Math.PI; 38 | } else if (x < 0 && y > 0) { 39 | return 180 * rate / Math.PI; 40 | } 41 | } 42 | 43 | /** 44 | * 定义加载框 在当前场景初始化的时候执行一次 45 | * @param node 加载框节点 46 | * @param scene 加载框 输出的场景 or 节点 47 | */ 48 | public setLoadingBox(node: cc.Node, scene: cc.Node) { 49 | this.loading_box = node; 50 | this.loading_box.zIndex = 99; 51 | this.loading_text = cc.find("text", this.loading_box).getComponent(cc.Label); 52 | this.loading_box.parent = scene; 53 | this.loading_box.active = false; 54 | } 55 | 56 | /** 57 | * 基础加载预制体 58 | * @param name 资源名字 59 | * @param callback 加载成功回调 60 | */ 61 | public loadPrefab(name: string, callback?: (result: any) => void) { 62 | this.loading_box.active = true; 63 | this.loading_text.string = "0%"; 64 | cc.loader.loadRes("prefab/" + name, cc.Prefab, (count, total, item) => { 65 | let val = count / total; 66 | this.loading_text.string = Math.floor(val * 100) + "%"; 67 | // console.log(val); 68 | }, (err, res) => { 69 | this.loading_box.active = false; 70 | // if (err) return this.showToast("资源加载失败,请重试"); 71 | if (callback) callback(res); 72 | }); 73 | } 74 | 75 | /** 76 | * 图片加载 resources 文件下 77 | * @param node 节点 78 | * @param src 路径 79 | * @param callback 加载成功回调 80 | */ 81 | public loadImg(node: cc.Node = null, src: string, callback?: (result: any) => void) { 82 | let load_count = 0; 83 | /** 加载失败时,重复加载 直到次数为 3 */ 84 | function load() { 85 | load_count += 1; 86 | cc.loader.loadRes(src, cc.SpriteFrame, (err, res) => { 87 | if (err) { 88 | console.log(node.name + "加载次数", load_count); 89 | if (load_count < 3) load(); 90 | } else { 91 | if (node) node.getComponent(cc.Sprite).spriteFrame = res; 92 | if (callback) callback(res); 93 | } 94 | }); 95 | } 96 | load(); 97 | } 98 | 99 | /** 100 | * 加载网络图片 101 | * @param node 节点 102 | * @param src 资源路径 103 | * @param type 加载图片类型 104 | */ 105 | public loadNetworkImg(node: cc.Node, src: string, type = "jpg") { 106 | cc.loader.load({ url: src, type: type }, (err: any, res: any) => { 107 | node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(res); 108 | }); 109 | } 110 | } -------------------------------------------------------------------------------- /client/assets/Script/utils/index.ts: -------------------------------------------------------------------------------- 1 | import ModuleCCutils from "./CCutils"; 2 | import { JavaScriptTypes, NumberSymbols } from "./interface"; 3 | 4 | class utilsModule extends ModuleCCutils { 5 | constructor() { 6 | super() 7 | } 8 | /** 9 | * 本地储存数据 10 | * @param key 对应的 key 值 11 | * @param data 对应的数据 12 | */ 13 | public saveData(key: string, data: any) { 14 | window.localStorage.setItem(key, JSON.stringify(data)); 15 | } 16 | 17 | /** 18 | * 获取本地数据 19 | * @param key 对应的 key 值 20 | */ 21 | public fetchData(key: string) { 22 | let data = window.localStorage.getItem(key) ? JSON.parse(window.localStorage.getItem(key)) : null; 23 | return data; 24 | } 25 | 26 | /** 清除本地数据 */ 27 | public removeData() { 28 | window.localStorage.clear(); 29 | } 30 | 31 | /** 长震动 */ 32 | public vibrateLong() { 33 | if ("vibrate" in window.navigator) { 34 | window.navigator.vibrate(400); 35 | } else if (window["wx"] && wx.vibrateLong) { 36 | wx.vibrateLong(); 37 | } 38 | } 39 | 40 | /** 短震动 */ 41 | public vibrateShort() { 42 | if ("vibrate" in window.navigator) { 43 | window.navigator.vibrate(15); 44 | } else if (window["wx"] && wx.vibrateShort) { 45 | wx.vibrateShort(); 46 | } 47 | } 48 | 49 | /** 50 | * 带单位的数值转换 51 | * @param value 数字 52 | */ 53 | public unitsNumber(value: number = 0): string | number { 54 | // 取整 55 | value = Math.floor(value); 56 | if (value == 0) return ""; 57 | /** 单位 */ 58 | let units = ["", "k", "m", "b", "f", "e", "ae", "be", "ce", "de", "ee", "fe", "ge", "he", "ie"]; 59 | /** 索引 */ 60 | let index = Math.floor(Math.log(value) / Math.log(1000)); 61 | /** 结果 */ 62 | let result: number | string = value / Math.pow(1000, index); 63 | if (index === 0) return result; 64 | result = result.toFixed(3); 65 | // 不进行四舍五入 取小数点后一位 66 | result = result.substring(0, result.lastIndexOf(".") + 2); 67 | return result + units[index]; 68 | } 69 | 70 | /** 71 | * 数字运算(主要用于小数点精度问题) 72 | * [see](https://juejin.im/post/6844904066418491406#heading-12) 73 | * @param a 前面的值 74 | * @param type 计算方式 75 | * @param b 后面的值 76 | * @example 77 | * ```js 78 | * // 可链式调用 79 | * const res = computeNumber(1.3, "-", 1.2).next("+", 1.5).next("*", 2.3).next("/", 0.2).result; 80 | * console.log(res); 81 | * ``` 82 | */ 83 | computeNumber(a: number, type: NumberSymbols, b: number) { 84 | const THAT = this; 85 | /** 86 | * 获取数字小数点的长度 87 | * @param n 数字 88 | */ 89 | function getDecimalLength(n: number) { 90 | const decimal = n.toString().split(".")[1]; 91 | return decimal ? decimal.length : 0; 92 | } 93 | /** 倍率 */ 94 | const power = Math.pow(10, Math.max(getDecimalLength(a), getDecimalLength(b))); 95 | let result = 0; 96 | 97 | // 防止出现 `33.33333*100000 = 3333332.9999999995` && `33.33*10 = 333.29999999999995` 这类情况做的暴力处理 98 | a = Math.round(a * power); 99 | b = Math.round(b * power); 100 | 101 | switch (type) { 102 | case "+": 103 | result = (a + b) / power; 104 | break; 105 | case "-": 106 | result = (a - b) / power; 107 | break; 108 | case "*": 109 | result = (a * b) / (power * power); 110 | break; 111 | case "/": 112 | result = a / b; 113 | break; 114 | } 115 | 116 | return { 117 | /** 计算结果 */ 118 | result, 119 | /** 120 | * 继续计算 121 | * @param nextType 继续计算方式 122 | * @param nextValue 继续计算的值 123 | */ 124 | next(nextType: NumberSymbols, nextValue: number) { 125 | return THAT.computeNumber(result, nextType, nextValue); 126 | }, 127 | }; 128 | } 129 | 130 | /** 131 | * 范围随机数 132 | * @param min 最小数 133 | * @param max 最大数 134 | */ 135 | public ranInt(min: number, max: number) { 136 | return Math.round(Math.random() * (max - min) + min); 137 | } 138 | 139 | /** 140 | * 检测类型 141 | * @param target 检测的目标 142 | */ 143 | checkType(target: any) { 144 | const value: string = Object.prototype.toString.call(target); 145 | const result = (value.match(/\[object (\S*)\]/) as RegExpMatchArray)[1]; 146 | return result.toLocaleLowerCase() as JavaScriptTypes; 147 | } 148 | 149 | /** 150 | * 格式化日期 151 | * @param value 指定日期 152 | * @param format 格式化的规则 153 | * @example 154 | * ```js 155 | * formatDate(); 156 | * formatDate(1603264465956); 157 | * formatDate(1603264465956, "h:m:s"); 158 | * formatDate(1603264465956, "Y年M月D日"); 159 | * ``` 160 | */ 161 | public formatDate(value: string | number = Date.now(), format = "Y-M-D h:m:s") { 162 | const formatNumber = (n: number) => `0${n}`.slice(-2); 163 | const date = new Date(value); 164 | const formatList = ["Y", "M", "D", "h", "m", "s"]; 165 | const resultList = []; 166 | resultList.push(date.getFullYear().toString()); 167 | resultList.push(formatNumber(date.getMonth() + 1)); 168 | resultList.push(formatNumber(date.getDate())); 169 | resultList.push(formatNumber(date.getHours())); 170 | resultList.push(formatNumber(date.getMinutes())); 171 | resultList.push(formatNumber(date.getSeconds())); 172 | for (let i = 0; i < resultList.length; i++) { 173 | format = format.replace(formatList[i], resultList[i]); 174 | } 175 | return format; 176 | } 177 | 178 | /** 179 | * 数组中随机取几个元素 180 | * @param {array} arr 数组 181 | * @param count 元素个数 182 | */ 183 | public getRandomArrayElements(array: Array, count: number) { 184 | /** 数组长度 */ 185 | let length = array.length; 186 | /** 最小长度 */ 187 | let min = length - count, temp: T, range: number; 188 | while (length-- > min) { 189 | range = Math.floor((length + 1) * Math.random()); 190 | temp = array[range]; 191 | array[range] = array[length]; 192 | array[length] = temp; 193 | } 194 | return array.slice(min); 195 | } 196 | 197 | /** 198 | * 随机打乱数组 199 | * @param array 200 | */ 201 | public shuffleArray(array: Array) { 202 | // 洗牌随机法(性能最优) 203 | for (let i = array.length - 1; i >= 0; i--) { 204 | let randomIndex = Math.floor(Math.random() * (i + 1)); 205 | let itemAtIndex = array[randomIndex]; 206 | array[randomIndex] = array[i]; 207 | array[i] = itemAtIndex; 208 | } 209 | return array; 210 | } 211 | 212 | /** 213 | * 将指定位置的元素置顶 214 | * @param array 改数组 215 | * @param index 元素索引 216 | */ 217 | public zIndexToTop(array: Array, index: number) { 218 | if (index != 0) { 219 | let item = array[index]; 220 | array.splice(index, 1); 221 | array.unshift(item); 222 | } else { 223 | console.log("已经处于置顶"); 224 | } 225 | } 226 | 227 | /** 228 | * 将指定位置的元素置底 229 | * @param array 改数组 230 | * @param index 元素索引 231 | */ 232 | public zIndexToBottom(array: Array, index: number) { 233 | if (index != array.length - 1) { 234 | let item = array[index]; 235 | array.splice(index, 1); 236 | array.push(item); 237 | } else { 238 | console.log("已经处于置底"); 239 | } 240 | } 241 | 242 | } 243 | 244 | /** 工具模块 */ 245 | const utils = new utilsModule(); 246 | 247 | export default utils; 248 | -------------------------------------------------------------------------------- /client/assets/Script/utils/interface.ts: -------------------------------------------------------------------------------- 1 | /** 运算符号 */ 2 | export type NumberSymbols = "+" | "-"| "*" | "/"; 3 | 4 | /** JavaScript类型 */ 5 | export type JavaScriptTypes = "string" | "number" | "array" | "object" | "function" | "null" | "undefined"; 6 | 7 | /** 拉起视频传参 */ 8 | export interface OptionsShowVideo { 9 | /** 视频`id`默认拿当前配置`id` */ 10 | videoId?: string 11 | /** 成功看完视频回调 */ 12 | success?: () => void 13 | /** 视频出错回调 */ 14 | fail?: (error: any) => void 15 | } -------------------------------------------------------------------------------- /client/assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "de1e12c8-8e91-42b4-b3fa-e6bf0a609f23", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/resources/audio.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "62d4d38e-6cda-4524-8a5e-a12e7a1e2d91", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/resources/audio/audio.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/resources/audio/audio.txt -------------------------------------------------------------------------------- /client/assets/resources/audio/audio.txt.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "67575283-2934-443c-aa8e-0175210d9d3c", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /client/assets/resources/images.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7200957a-1676-4b0a-8fef-42c54c8efcbc", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/resources/images/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/resources/images/white.png -------------------------------------------------------------------------------- /client/assets/resources/images/white.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "ba539917-cb3e-4db5-b127-2aecc6ca03b8", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "white": { 11 | "ver": "1.0.4", 12 | "uuid": "303e3022-1ffc-4eca-a494-348bba5200dd", 13 | "rawTextureUuid": "ba539917-cb3e-4db5-b127-2aecc6ca03b8", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 3, 26 | "borderBottom": 3, 27 | "borderLeft": 3, 28 | "borderRight": 3, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/resources/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "933425d4-e070-4359-b1a6-6ef8d2002a0b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/resources/prefab/rank-box.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "uuid": "6c5e157a-1f9c-405c-b8d2-2eb5d5d0cfff", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /client/assets/static.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ba943589-4bb7-49fd-b61c-ef63b05c3552", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/static/audio.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3a0480e3-3e70-4515-9ca3-81a3ca3aed8f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/static/audio/audio.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/audio/audio.txt -------------------------------------------------------------------------------- /client/assets/static/audio/audio.txt.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "5e381550-2417-4ecd-97d7-fe10ace84a84", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /client/assets/static/images.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ee7a5614-d5e9-4e1b-a3d3-e170dc570151", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/static/images/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/battery.png -------------------------------------------------------------------------------- /client/assets/static/images/battery.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "dd6f2d3b-c055-4079-9b60-613e83c800c9", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "battery": { 11 | "ver": "1.0.4", 12 | "uuid": "7f0f5f77-741c-4947-bb70-f4dedc79a6b9", 13 | "rawTextureUuid": "dd6f2d3b-c055-4079-9b60-613e83c800c9", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 82, 22 | "height": 88, 23 | "rawWidth": 82, 24 | "rawHeight": 88, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/bullet.png -------------------------------------------------------------------------------- /client/assets/static/images/bullet.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "7535ae33-a5f5-45ae-b0dd-1110a5e605cb", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "bullet": { 11 | "ver": "1.0.4", 12 | "uuid": "6a02a71f-8c09-4f4b-8df5-b1a409999aa1", 13 | "rawTextureUuid": "7535ae33-a5f5-45ae-b0dd-1110a5e605cb", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 29, 22 | "height": 127, 23 | "rawWidth": 29, 24 | "rawHeight": 127, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/cover.png -------------------------------------------------------------------------------- /client/assets/static/images/cover.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "fa7f1061-0464-47ba-8077-005af7fe82d0", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cover": { 11 | "ver": "1.0.4", 12 | "uuid": "8ae99863-a1bc-432e-8c57-c708d90e3c9d", 13 | "rawTextureUuid": "fa7f1061-0464-47ba-8077-005af7fe82d0", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 3, 26 | "borderBottom": 3, 27 | "borderLeft": 3, 28 | "borderRight": 3, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/cup-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/cup-first.png -------------------------------------------------------------------------------- /client/assets/static/images/cup-first.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "cdab14cd-4f0d-4168-9232-77fb9a7a1006", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-first": { 11 | "ver": "1.0.4", 12 | "uuid": "fa3077d4-d437-4327-b541-3f2e1df30438", 13 | "rawTextureUuid": "cdab14cd-4f0d-4168-9232-77fb9a7a1006", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 71, 23 | "rawWidth": 42, 24 | "rawHeight": 71, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/cup-second.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/cup-second.png -------------------------------------------------------------------------------- /client/assets/static/images/cup-second.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "6ea3182d-ce07-4008-af6f-a74d638d3ff8", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-second": { 11 | "ver": "1.0.4", 12 | "uuid": "152c73f6-7da3-4b4f-832c-e25ffec85f9f", 13 | "rawTextureUuid": "6ea3182d-ce07-4008-af6f-a74d638d3ff8", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 72, 23 | "rawWidth": 42, 24 | "rawHeight": 72, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/cup-third.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/cup-third.png -------------------------------------------------------------------------------- /client/assets/static/images/cup-third.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "375a222e-723a-4b8a-b5a0-be0889f99ebc", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-third": { 11 | "ver": "1.0.4", 12 | "uuid": "430e9633-0fe7-4538-ace2-f0dd25719faf", 13 | "rawTextureUuid": "375a222e-723a-4b8a-b5a0-be0889f99ebc", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 71, 23 | "rawWidth": 42, 24 | "rawHeight": 71, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/user-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/user-default.png -------------------------------------------------------------------------------- /client/assets/static/images/user-default.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "0d8d9605-2b78-41ff-b32a-e6cc8a56a691", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "user-default": { 11 | "ver": "1.0.4", 12 | "uuid": "964b96b3-967a-4fa3-acb0-cc593e753dfe", 13 | "rawTextureUuid": "0d8d9605-2b78-41ff-b32a-e6cc8a56a691", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 128, 22 | "height": 128, 23 | "rawWidth": 128, 24 | "rawHeight": 128, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/images/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/assets/static/images/white.png -------------------------------------------------------------------------------- /client/assets/static/images/white.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "754cfd46-4a14-4094-82eb-3af47dd08784", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "white": { 11 | "ver": "1.0.4", 12 | "uuid": "fa466054-7276-40cd-8ca6-c4aaa8d0f992", 13 | "rawTextureUuid": "754cfd46-4a14-4094-82eb-3af47dd08784", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /client/assets/static/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3001d002-10be-4195-ada4-201bdee11c1a", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /client/assets/static/prefab/bullet.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false, 12 | "readonly": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "bullet", 17 | "_objFlags": 0, 18 | "_parent": null, 19 | "_children": [], 20 | "_active": true, 21 | "_level": 1, 22 | "_components": [ 23 | { 24 | "__id__": 2 25 | }, 26 | { 27 | "__id__": 3 28 | } 29 | ], 30 | "_prefab": { 31 | "__id__": 4 32 | }, 33 | "_opacity": 255, 34 | "_color": { 35 | "__type__": "cc.Color", 36 | "r": 255, 37 | "g": 255, 38 | "b": 255, 39 | "a": 255 40 | }, 41 | "_contentSize": { 42 | "__type__": "cc.Size", 43 | "width": 29, 44 | "height": 127 45 | }, 46 | "_anchorPoint": { 47 | "__type__": "cc.Vec2", 48 | "x": 0.5, 49 | "y": 0.5 50 | }, 51 | "_position": { 52 | "__type__": "cc.Vec3", 53 | "x": 0, 54 | "y": 0, 55 | "z": 0 56 | }, 57 | "_scale": { 58 | "__type__": "cc.Vec3", 59 | "x": 1, 60 | "y": 1, 61 | "z": 1 62 | }, 63 | "_quat": { 64 | "__type__": "cc.Quat", 65 | "x": 0, 66 | "y": 0, 67 | "z": 0, 68 | "w": 1 69 | }, 70 | "_skewX": 0, 71 | "_skewY": 0, 72 | "_zIndex": 0, 73 | "_is3DNode": false, 74 | "groupIndex": 0, 75 | "_id": "" 76 | }, 77 | { 78 | "__type__": "cc.Sprite", 79 | "_name": "", 80 | "_objFlags": 0, 81 | "node": { 82 | "__id__": 1 83 | }, 84 | "_enabled": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_spriteFrame": { 88 | "__uuid__": "6a02a71f-8c09-4f4b-8df5-b1a409999aa1" 89 | }, 90 | "_type": 0, 91 | "_sizeMode": 1, 92 | "_fillType": 0, 93 | "_fillCenter": { 94 | "__type__": "cc.Vec2", 95 | "x": 0, 96 | "y": 0 97 | }, 98 | "_fillStart": 0, 99 | "_fillRange": 0, 100 | "_isTrimmedMode": true, 101 | "_state": 0, 102 | "_atlas": null, 103 | "_id": "" 104 | }, 105 | { 106 | "__type__": "344613rHSlCMYkyUg1pcw40", 107 | "_name": "", 108 | "_objFlags": 0, 109 | "node": { 110 | "__id__": 1 111 | }, 112 | "_enabled": true, 113 | "speed": 1200, 114 | "angle": 0, 115 | "_id": "" 116 | }, 117 | { 118 | "__type__": "cc.PrefabInfo", 119 | "root": { 120 | "__id__": 1 121 | }, 122 | "asset": { 123 | "__uuid__": "359383ff-dfbd-4481-af9b-0165676cc0be" 124 | }, 125 | "fileId": "9c96oHyJZAxbpdfuiiNINp", 126 | "sync": false 127 | } 128 | ] -------------------------------------------------------------------------------- /client/assets/static/prefab/bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "uuid": "359383ff-dfbd-4481-af9b-0165676cc0be", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /client/assets/static/prefab/loading-box.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false, 12 | "readonly": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "loading-box", 17 | "_objFlags": 0, 18 | "_parent": null, 19 | "_children": [ 20 | { 21 | "__id__": 2 22 | }, 23 | { 24 | "__id__": 5 25 | } 26 | ], 27 | "_active": true, 28 | "_level": 2, 29 | "_components": [ 30 | { 31 | "__id__": 8 32 | }, 33 | { 34 | "__id__": 9 35 | }, 36 | { 37 | "__id__": 10 38 | } 39 | ], 40 | "_prefab": { 41 | "__id__": 12 42 | }, 43 | "_opacity": 255, 44 | "_color": { 45 | "__type__": "cc.Color", 46 | "r": 255, 47 | "g": 255, 48 | "b": 255, 49 | "a": 255 50 | }, 51 | "_contentSize": { 52 | "__type__": "cc.Size", 53 | "width": 750, 54 | "height": 1334 55 | }, 56 | "_anchorPoint": { 57 | "__type__": "cc.Vec2", 58 | "x": 0.5, 59 | "y": 0.5 60 | }, 61 | "_position": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_scale": { 68 | "__type__": "cc.Vec3", 69 | "x": 1, 70 | "y": 1, 71 | "z": 1 72 | }, 73 | "_quat": { 74 | "__type__": "cc.Quat", 75 | "x": 0, 76 | "y": 0, 77 | "z": 0, 78 | "w": 1 79 | }, 80 | "_skewX": 0, 81 | "_skewY": 0, 82 | "_zIndex": 0, 83 | "_is3DNode": false, 84 | "groupIndex": 0, 85 | "_id": "" 86 | }, 87 | { 88 | "__type__": "cc.Node", 89 | "_name": "white", 90 | "_objFlags": 0, 91 | "_parent": { 92 | "__id__": 1 93 | }, 94 | "_children": [], 95 | "_active": true, 96 | "_level": 3, 97 | "_components": [ 98 | { 99 | "__id__": 3 100 | } 101 | ], 102 | "_prefab": { 103 | "__id__": 4 104 | }, 105 | "_opacity": 255, 106 | "_color": { 107 | "__type__": "cc.Color", 108 | "r": 14, 109 | "g": 190, 110 | "b": 188, 111 | "a": 255 112 | }, 113 | "_contentSize": { 114 | "__type__": "cc.Size", 115 | "width": 150, 116 | "height": 80 117 | }, 118 | "_anchorPoint": { 119 | "__type__": "cc.Vec2", 120 | "x": 0.5, 121 | "y": 0.5 122 | }, 123 | "_position": { 124 | "__type__": "cc.Vec3", 125 | "x": 0, 126 | "y": 0, 127 | "z": 0 128 | }, 129 | "_scale": { 130 | "__type__": "cc.Vec3", 131 | "x": 1, 132 | "y": 1, 133 | "z": 1 134 | }, 135 | "_quat": { 136 | "__type__": "cc.Quat", 137 | "x": 0, 138 | "y": 0, 139 | "z": 0, 140 | "w": 1 141 | }, 142 | "_skewX": 0, 143 | "_skewY": 0, 144 | "_zIndex": 0, 145 | "_is3DNode": false, 146 | "groupIndex": 0, 147 | "_id": "" 148 | }, 149 | { 150 | "__type__": "cc.Sprite", 151 | "_name": "", 152 | "_objFlags": 0, 153 | "node": { 154 | "__id__": 2 155 | }, 156 | "_enabled": true, 157 | "_srcBlendFactor": 770, 158 | "_dstBlendFactor": 771, 159 | "_spriteFrame": { 160 | "__uuid__": "fa466054-7276-40cd-8ca6-c4aaa8d0f992" 161 | }, 162 | "_type": 0, 163 | "_sizeMode": 0, 164 | "_fillType": 0, 165 | "_fillCenter": { 166 | "__type__": "cc.Vec2", 167 | "x": 0, 168 | "y": 0 169 | }, 170 | "_fillStart": 0, 171 | "_fillRange": 0, 172 | "_isTrimmedMode": true, 173 | "_state": 0, 174 | "_atlas": null, 175 | "_id": "" 176 | }, 177 | { 178 | "__type__": "cc.PrefabInfo", 179 | "root": { 180 | "__id__": 1 181 | }, 182 | "asset": { 183 | "__id__": 0 184 | }, 185 | "fileId": "5blX4YjttDFbKQxK/q5YSo", 186 | "sync": false 187 | }, 188 | { 189 | "__type__": "cc.Node", 190 | "_name": "text", 191 | "_objFlags": 0, 192 | "_parent": { 193 | "__id__": 1 194 | }, 195 | "_children": [], 196 | "_active": true, 197 | "_level": 3, 198 | "_components": [ 199 | { 200 | "__id__": 6 201 | } 202 | ], 203 | "_prefab": { 204 | "__id__": 7 205 | }, 206 | "_opacity": 255, 207 | "_color": { 208 | "__type__": "cc.Color", 209 | "r": 255, 210 | "g": 255, 211 | "b": 255, 212 | "a": 255 213 | }, 214 | "_contentSize": { 215 | "__type__": "cc.Size", 216 | "width": 22.25, 217 | "height": 50 218 | }, 219 | "_anchorPoint": { 220 | "__type__": "cc.Vec2", 221 | "x": 0.5, 222 | "y": 0.5 223 | }, 224 | "_position": { 225 | "__type__": "cc.Vec3", 226 | "x": 0, 227 | "y": 0, 228 | "z": 0 229 | }, 230 | "_scale": { 231 | "__type__": "cc.Vec3", 232 | "x": 1, 233 | "y": 1, 234 | "z": 1 235 | }, 236 | "_quat": { 237 | "__type__": "cc.Quat", 238 | "x": 0, 239 | "y": 0, 240 | "z": 0, 241 | "w": 1 242 | }, 243 | "_skewX": 0, 244 | "_skewY": 0, 245 | "_zIndex": 0, 246 | "_is3DNode": false, 247 | "groupIndex": 0, 248 | "_rotationX": 0, 249 | "_rotationY": 0, 250 | "_id": "" 251 | }, 252 | { 253 | "__type__": "cc.Label", 254 | "_name": "", 255 | "_objFlags": 0, 256 | "node": { 257 | "__id__": 5 258 | }, 259 | "_enabled": true, 260 | "_srcBlendFactor": 1, 261 | "_dstBlendFactor": 771, 262 | "_useOriginalSize": false, 263 | "_string": "0", 264 | "_N$string": "0", 265 | "_fontSize": 40, 266 | "_lineHeight": 50, 267 | "_enableWrapText": true, 268 | "_N$file": null, 269 | "_isSystemFontUsed": true, 270 | "_spacingX": 0, 271 | "_N$horizontalAlign": 1, 272 | "_N$verticalAlign": 1, 273 | "_N$fontFamily": "Arial", 274 | "_N$overflow": 0, 275 | "_id": "" 276 | }, 277 | { 278 | "__type__": "cc.PrefabInfo", 279 | "root": { 280 | "__id__": 1 281 | }, 282 | "asset": { 283 | "__id__": 0 284 | }, 285 | "fileId": "04oc3pzaRDTolIIlDz04P3", 286 | "sync": false 287 | }, 288 | { 289 | "__type__": "cc.Sprite", 290 | "_name": "", 291 | "_objFlags": 0, 292 | "node": { 293 | "__id__": 1 294 | }, 295 | "_enabled": true, 296 | "_srcBlendFactor": 770, 297 | "_dstBlendFactor": 771, 298 | "_spriteFrame": { 299 | "__uuid__": "8ae99863-a1bc-432e-8c57-c708d90e3c9d" 300 | }, 301 | "_type": 1, 302 | "_sizeMode": 0, 303 | "_fillType": 0, 304 | "_fillCenter": { 305 | "__type__": "cc.Vec2", 306 | "x": 0, 307 | "y": 0 308 | }, 309 | "_fillStart": 0, 310 | "_fillRange": 0, 311 | "_isTrimmedMode": true, 312 | "_state": 0, 313 | "_atlas": null, 314 | "_id": "" 315 | }, 316 | { 317 | "__type__": "cc.Widget", 318 | "_name": "", 319 | "_objFlags": 0, 320 | "node": { 321 | "__id__": 1 322 | }, 323 | "_enabled": true, 324 | "alignMode": 1, 325 | "_target": null, 326 | "_alignFlags": 45, 327 | "_left": 0, 328 | "_right": 0, 329 | "_top": 0, 330 | "_bottom": 0, 331 | "_verticalCenter": 0, 332 | "_horizontalCenter": 0, 333 | "_isAbsLeft": true, 334 | "_isAbsRight": true, 335 | "_isAbsTop": true, 336 | "_isAbsBottom": true, 337 | "_isAbsHorizontalCenter": true, 338 | "_isAbsVerticalCenter": true, 339 | "_originalWidth": 10, 340 | "_originalHeight": 10, 341 | "_id": "" 342 | }, 343 | { 344 | "__type__": "cc.Button", 345 | "_name": "", 346 | "_objFlags": 0, 347 | "node": { 348 | "__id__": 1 349 | }, 350 | "_enabled": true, 351 | "duration": 0.1, 352 | "zoomScale": 1.2, 353 | "clickEvents": [ 354 | { 355 | "__id__": 11 356 | } 357 | ], 358 | "_N$interactable": true, 359 | "_N$enableAutoGrayEffect": false, 360 | "_N$transition": 0, 361 | "transition": 0, 362 | "_N$normalColor": { 363 | "__type__": "cc.Color", 364 | "r": 214, 365 | "g": 214, 366 | "b": 214, 367 | "a": 255 368 | }, 369 | "_N$pressedColor": { 370 | "__type__": "cc.Color", 371 | "r": 211, 372 | "g": 211, 373 | "b": 211, 374 | "a": 255 375 | }, 376 | "pressedColor": { 377 | "__type__": "cc.Color", 378 | "r": 211, 379 | "g": 211, 380 | "b": 211, 381 | "a": 255 382 | }, 383 | "_N$hoverColor": { 384 | "__type__": "cc.Color", 385 | "r": 255, 386 | "g": 255, 387 | "b": 255, 388 | "a": 255 389 | }, 390 | "hoverColor": { 391 | "__type__": "cc.Color", 392 | "r": 255, 393 | "g": 255, 394 | "b": 255, 395 | "a": 255 396 | }, 397 | "_N$disabledColor": { 398 | "__type__": "cc.Color", 399 | "r": 124, 400 | "g": 124, 401 | "b": 124, 402 | "a": 255 403 | }, 404 | "_N$normalSprite": null, 405 | "_N$pressedSprite": null, 406 | "pressedSprite": null, 407 | "_N$hoverSprite": null, 408 | "hoverSprite": null, 409 | "_N$disabledSprite": null, 410 | "_N$target": null, 411 | "_id": "" 412 | }, 413 | { 414 | "__type__": "cc.ClickEvent", 415 | "target": { 416 | "__id__": 1 417 | }, 418 | "component": "", 419 | "_componentId": "cc.Button", 420 | "handler": "", 421 | "customEventData": "" 422 | }, 423 | { 424 | "__type__": "cc.PrefabInfo", 425 | "root": { 426 | "__id__": 1 427 | }, 428 | "asset": { 429 | "__id__": 0 430 | }, 431 | "fileId": "1b9jIhVgdH/JgVfwUH7O88", 432 | "sync": false 433 | } 434 | ] -------------------------------------------------------------------------------- /client/assets/static/prefab/loading-box.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "uuid": "14d195e2-9a7d-41b1-a0d2-891784b3a96b", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /client/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /client/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos2d-html5", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /client/settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "android-instant": { 3 | "REMOTE_SERVER_ROOT": "", 4 | "host": "", 5 | "pathPattern": "", 6 | "recordPath": "", 7 | "scheme": "https", 8 | "skipRecord": false 9 | }, 10 | "appKey": "", 11 | "appSecret": "", 12 | "encryptJs": true, 13 | "excludeScenes": [], 14 | "fb-instant-games": {}, 15 | "includeAnySDK": false, 16 | "includeSDKBox": false, 17 | "inlineSpriteFrames": true, 18 | "inlineSpriteFrames_native": true, 19 | "jailbreakPlatform": false, 20 | "md5Cache": true, 21 | "mergeStartScene": false, 22 | "oauthLoginServer": "", 23 | "optimizeHotUpdate": false, 24 | "orientation": { 25 | "landscapeLeft": true, 26 | "landscapeRight": true, 27 | "portrait": false, 28 | "upsideDown": false 29 | }, 30 | "packageName": "org.cocos2d.helloworld", 31 | "privateKey": "", 32 | "qqplay": { 33 | "REMOTE_SERVER_ROOT": "", 34 | "orientation": "portrait", 35 | "zip": false 36 | }, 37 | "startScene": "5e0fbff6-0139-4705-9c93-b2329571c9fc", 38 | "title": "template", 39 | "webOrientation": "auto", 40 | "wechatgame": { 41 | "REMOTE_SERVER_ROOT": "", 42 | "appid": "wx9a46242547336310", 43 | "orientation": "portrait", 44 | "subContext": "sub" 45 | }, 46 | "xxteaKey": "d252d38c-3267-45", 47 | "zipCompressJs": true 48 | } -------------------------------------------------------------------------------- /client/settings/builder.panel.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeScenes": [], 3 | "packageName": "org.cocos2d.helloworld", 4 | "platform": "web-mobile", 5 | "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", 6 | "title": "HelloWorld" 7 | } -------------------------------------------------------------------------------- /client/settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "collision-matrix": [ 3 | [ 4 | true 5 | ] 6 | ], 7 | "design-resolution-height": 1334, 8 | "design-resolution-width": 750, 9 | "excluded-modules": [ 10 | "Spine Skeleton", 11 | "DragonBones", 12 | "PageView", 13 | "PageViewIndicator", 14 | "Slider", 15 | "EditBox", 16 | "VideoPlayer", 17 | "WebView", 18 | "Collider", 19 | "Physics", 20 | "StudioComponent", 21 | "Intersection", 22 | "Native NetWork", 23 | "3D", 24 | "Mesh" 25 | ], 26 | "fit-height": false, 27 | "fit-width": true, 28 | "group-list": [ 29 | "default" 30 | ], 31 | "simulator-orientation": false, 32 | "simulator-resolution": { 33 | "height": 640, 34 | "width": 960 35 | }, 36 | "use-customize-simulator": false, 37 | "use-project-simulator-setting": false, 38 | "start-scene": "current", 39 | "last-module-event-record-time": 0, 40 | "assets-sort-type": "name", 41 | "facebook": { 42 | "enable": false, 43 | "appID": "", 44 | "live": { 45 | "enable": false 46 | }, 47 | "audience": { 48 | "enable": false 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /client/settings/services.json: -------------------------------------------------------------------------------- 1 | { 2 | "services": [ 3 | { 4 | "service_id": "235", 5 | "service_name": "Cocos Analytics", 6 | "service_icon": "https://account.cocos.com/client/3f8f31ccf66995e183044f167c092395.png", 7 | "service_desc": "提供最核心最基本的数据、标准化界面功能简洁易用、数据准确性最好", 8 | "service_title": "精准了解游戏的新增、活跃、留存、付费等数据", 9 | "service_guide_url": "https://n-analytics.cocos.com/docs/", 10 | "service_sample_url": "https://github.com/cocos-creator/tutorial-dark-slash/tree/analytics", 11 | "service_dev_url": "http://analytics.cocos.com/realtime/jump_to/", 12 | "service_type": "3", 13 | "service_type_zh": "公司和个人游戏", 14 | "support_platform": [ 15 | "Android", 16 | "iOS", 17 | "HTML5" 18 | ], 19 | "package_download_url": "https://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip", 20 | "package_version_desc": "更新日期:2019/6/10
\n
更新说明:
\n1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口
\n2、如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 support-cocos@cocos.com", 21 | "service_component_name": "service-analytics", 22 | "package_versions": [ 23 | "1.2.1_2.1.0", 24 | "1.2.0_2.1.0", 25 | "1.1.7_2.0.3", 26 | "1.1.6_2.0.1_2.0.2", 27 | "1.1.5_2.0.1", 28 | "1.1.4_2.0.1", 29 | "1.1.3_2.0.1", 30 | "1.1.2_2.0.0", 31 | "1.0.0_1.0.5" 32 | ], 33 | "build_platform": [], 34 | "require_verify": 0, 35 | "service_price": "", 36 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 37 | }, 38 | { 39 | "service_id": "241", 40 | "service_name": "Matchvs", 41 | "service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png", 42 | "service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。", 43 | "service_title": "专业成熟的移动游戏联网与服务端解决方案", 44 | "service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator", 45 | "service_sample_url": "http://www.matchvs.com/serviceCourse", 46 | "service_dev_url": "http://www.matchvs.com/cocosLogin", 47 | "service_type": "3", 48 | "service_type_zh": "公司和个人游戏", 49 | "support_platform": [ 50 | "Android", 51 | "iOS", 52 | "HTML5" 53 | ], 54 | "package_download_url": "https://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip", 55 | "package_version_desc": "

更新日期: 2019/07/18\n更新内容:\n1、修复多节点登录返回值错误\n2、修复FaceBook平台受限安全策略的问题

", 56 | "service_component_name": "service-matchvs", 57 | "package_versions": [ 58 | "1.0.9_3.7.9.9", 59 | "1.0.7_3.7.9.6", 60 | "1.0.6_3.7.9.2", 61 | "1.0.5_3.7.7.3", 62 | "1.0.3_3.7.6.4" 63 | ], 64 | "build_platform": [], 65 | "require_verify": 0, 66 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 67 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 68 | }, 69 | { 70 | "service_id": "242", 71 | "service_name": "Agora Voice", 72 | "service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png", 73 | "service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。", 74 | "service_title": "游戏内置实时语音", 75 | "service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator", 76 | "service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora", 77 | "service_dev_url": "https://sso.agora.io/api/oauth/cocos/login", 78 | "service_type": "3", 79 | "service_type_zh": "公司和个人游戏", 80 | "support_platform": [ 81 | "Android", 82 | "iOS", 83 | "HTML5" 84 | ], 85 | "package_download_url": "https://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip", 86 | "package_version_desc": "更新日期:2019/06/27
\n
更新内容:
\n1、修复部分BUG
\n2、代码优化", 87 | "service_component_name": "service-agora", 88 | "package_versions": [ 89 | "1.0.2_2.2.3.20_2.5.2", 90 | "1.0.1_2.2.3.20_2.5.2" 91 | ], 92 | "build_platform": [], 93 | "require_verify": 1, 94 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 95 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 96 | } 97 | ], 98 | "game": { 99 | "name": "未知游戏", 100 | "appid": "UNKNOW" 101 | } 102 | } -------------------------------------------------------------------------------- /client/template-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/client/template-banner.png -------------------------------------------------------------------------------- /client/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TEMPLATES.helloworld-ts.name", 3 | "desc": "TEMPLATES.helloworld-ts.desc", 4 | "banner": "template-banner.png" 5 | } -------------------------------------------------------------------------------- /client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": [ "dom", "es5", "es2015.promise" ], 5 | "target": "es5", 6 | "allowJs": true, 7 | "experimentalDecorators": true, 8 | "skipLibCheck": true 9 | }, 10 | "exclude": [ 11 | "node_modules", 12 | "library", 13 | "local", 14 | "temp", 15 | "build", 16 | "settings" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /sub/.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /sub/assets/images.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "70a8dcf2-f2b3-4e07-bb2b-b83f109e4ef2", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /sub/assets/images/bg_rectangle_tyyl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/bg_rectangle_tyyl.png -------------------------------------------------------------------------------- /sub/assets/images/bg_rectangle_tyyl.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "4b5f0b7e-7377-4885-ab57-70bb9a272c0a", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "bg_rectangle_tyyl": { 11 | "ver": "1.0.3", 12 | "uuid": "115c62dd-f619-4419-98cc-a9ffbc4182a4", 13 | "rawTextureUuid": "4b5f0b7e-7377-4885-ab57-70bb9a272c0a", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 620, 22 | "height": 142, 23 | "rawWidth": 620, 24 | "rawHeight": 142, 25 | "borderTop": 10, 26 | "borderBottom": 21, 27 | "borderLeft": 14, 28 | "borderRight": 14, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/blue.png -------------------------------------------------------------------------------- /sub/assets/images/blue.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "15d69ca5-ca2b-41df-88d1-68a730fa20c0", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "blue": { 11 | "ver": "1.0.3", 12 | "uuid": "567cadd7-aa73-4642-bbb2-df28d65309c4", 13 | "rawTextureUuid": "15d69ca5-ca2b-41df-88d1-68a730fa20c0", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/cup-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/cup-first.png -------------------------------------------------------------------------------- /sub/assets/images/cup-first.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "82cb46e5-f700-4177-851d-8e680bf38663", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-first": { 11 | "ver": "1.0.3", 12 | "uuid": "6cab0475-e602-4b47-97a8-02fa948397ce", 13 | "rawTextureUuid": "82cb46e5-f700-4177-851d-8e680bf38663", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 71, 23 | "rawWidth": 42, 24 | "rawHeight": 71, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/cup-second.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/cup-second.png -------------------------------------------------------------------------------- /sub/assets/images/cup-second.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "a5ce2671-34e3-49c8-8675-39446c90c496", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-second": { 11 | "ver": "1.0.3", 12 | "uuid": "f237c06a-fa82-4876-9fe0-8901a28bb895", 13 | "rawTextureUuid": "a5ce2671-34e3-49c8-8675-39446c90c496", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 72, 23 | "rawWidth": 42, 24 | "rawHeight": 72, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/cup-third.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/cup-third.png -------------------------------------------------------------------------------- /sub/assets/images/cup-third.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "369de326-72e7-4261-8c1e-d9edd30f4204", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "cup-third": { 11 | "ver": "1.0.3", 12 | "uuid": "a8686559-f74e-4807-a808-d0a8eff599f0", 13 | "rawTextureUuid": "369de326-72e7-4261-8c1e-d9edd30f4204", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 42, 22 | "height": 71, 23 | "rawWidth": 42, 24 | "rawHeight": 71, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/icon_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/icon_first.png -------------------------------------------------------------------------------- /sub/assets/images/icon_first.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "e7bdbdce-e879-42c2-8456-f54673e30d3a", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "icon_first": { 11 | "ver": "1.0.3", 12 | "uuid": "b2dad19a-f5b6-426c-ab60-3f860f5ce535", 13 | "rawTextureUuid": "e7bdbdce-e879-42c2-8456-f54673e30d3a", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 61, 22 | "height": 50, 23 | "rawWidth": 61, 24 | "rawHeight": 50, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/icon_second.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/icon_second.png -------------------------------------------------------------------------------- /sub/assets/images/icon_second.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "7d619915-5f7a-4569-84ff-f10341d70894", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "icon_second": { 11 | "ver": "1.0.3", 12 | "uuid": "0dfa7448-49a1-47da-84f5-d5a4e1e0ac22", 13 | "rawTextureUuid": "7d619915-5f7a-4569-84ff-f10341d70894", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 61, 22 | "height": 50, 23 | "rawWidth": 61, 24 | "rawHeight": 50, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/icon_third.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/icon_third.png -------------------------------------------------------------------------------- /sub/assets/images/icon_third.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "1aa9ecae-aa47-4c06-8953-21e66406ece9", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "icon_third": { 11 | "ver": "1.0.3", 12 | "uuid": "4416b849-b1fc-433b-aca7-a67f9a7c9e30", 13 | "rawTextureUuid": "1aa9ecae-aa47-4c06-8953-21e66406ece9", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 61, 22 | "height": 50, 23 | "rawWidth": 61, 24 | "rawHeight": 50, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/item-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/item-bg.png -------------------------------------------------------------------------------- /sub/assets/images/item-bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "b9df086c-0810-4114-abec-51e4eb98e931", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "item-bg": { 11 | "ver": "1.0.3", 12 | "uuid": "3e4a6f00-6359-428b-b8a2-ad80a839203a", 13 | "rawTextureUuid": "b9df086c-0810-4114-abec-51e4eb98e931", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/user-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/user-default.png -------------------------------------------------------------------------------- /sub/assets/images/user-default.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "5a36ad16-a5de-4f12-9e2f-52f457f07f44", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "user-default": { 11 | "ver": "1.0.3", 12 | "uuid": "423f090d-2eae-43ec-8faa-9531af528b8c", 13 | "rawTextureUuid": "5a36ad16-a5de-4f12-9e2f-52f457f07f44", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 128, 22 | "height": 128, 23 | "rawWidth": 128, 24 | "rawHeight": 128, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/user.png -------------------------------------------------------------------------------- /sub/assets/images/user.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "f0c0f3e9-1c00-4256-9b0c-bc4f82fefccf", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "user": { 11 | "ver": "1.0.3", 12 | "uuid": "bd470dad-101b-4e56-9203-fd2e9d648d84", 13 | "rawTextureUuid": "f0c0f3e9-1c00-4256-9b0c-bc4f82fefccf", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 72, 22 | "height": 72, 23 | "rawWidth": 72, 24 | "rawHeight": 72, 25 | "borderTop": 0, 26 | "borderBottom": 0, 27 | "borderLeft": 0, 28 | "borderRight": 0, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/images/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis-hjs/cocos-template/a55ff25876b36b1762ca441adcd5c0c779154651/sub/assets/images/white.png -------------------------------------------------------------------------------- /sub/assets/images/white.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.0", 3 | "uuid": "172d607e-ac38-446e-91c9-0c6b382d60f7", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "platformSettings": {}, 9 | "subMetas": { 10 | "white": { 11 | "ver": "1.0.3", 12 | "uuid": "18ba8235-7247-490a-bbb0-6cfda7d57261", 13 | "rawTextureUuid": "172d607e-ac38-446e-91c9-0c6b382d60f7", 14 | "trimType": "auto", 15 | "trimThreshold": 1, 16 | "rotated": false, 17 | "offsetX": 0, 18 | "offsetY": 0, 19 | "trimX": 0, 20 | "trimY": 0, 21 | "width": 10, 22 | "height": 10, 23 | "rawWidth": 10, 24 | "rawHeight": 10, 25 | "borderTop": 2, 26 | "borderBottom": 2, 27 | "borderLeft": 2, 28 | "borderRight": 2, 29 | "subMetas": {} 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /sub/assets/item.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false, 12 | "readonly": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "item", 17 | "_objFlags": 0, 18 | "_parent": null, 19 | "_children": [ 20 | { 21 | "__id__": 2 22 | }, 23 | { 24 | "__id__": 6 25 | }, 26 | { 27 | "__id__": 9 28 | }, 29 | { 30 | "__id__": 12 31 | }, 32 | { 33 | "__id__": 15 34 | }, 35 | { 36 | "__id__": 18 37 | } 38 | ], 39 | "_active": true, 40 | "_level": 1, 41 | "_components": [ 42 | { 43 | "__id__": 21 44 | } 45 | ], 46 | "_prefab": { 47 | "__id__": 22 48 | }, 49 | "_opacity": 255, 50 | "_color": { 51 | "__type__": "cc.Color", 52 | "r": 255, 53 | "g": 255, 54 | "b": 255, 55 | "a": 255 56 | }, 57 | "_contentSize": { 58 | "__type__": "cc.Size", 59 | "width": 560, 60 | "height": 100 61 | }, 62 | "_anchorPoint": { 63 | "__type__": "cc.Vec2", 64 | "x": 0.5, 65 | "y": 0.5 66 | }, 67 | "_position": { 68 | "__type__": "cc.Vec3", 69 | "x": 0, 70 | "y": -50, 71 | "z": 0 72 | }, 73 | "_scale": { 74 | "__type__": "cc.Vec3", 75 | "x": 1, 76 | "y": 1, 77 | "z": 1 78 | }, 79 | "_quat": { 80 | "__type__": "cc.Quat", 81 | "x": 0, 82 | "y": 0, 83 | "z": 0, 84 | "w": 1 85 | }, 86 | "_skewX": 0, 87 | "_skewY": 0, 88 | "_zIndex": 0, 89 | "_is3DNode": false, 90 | "groupIndex": 0, 91 | "_id": "" 92 | }, 93 | { 94 | "__type__": "cc.Node", 95 | "_name": "rank", 96 | "_objFlags": 0, 97 | "_parent": { 98 | "__id__": 1 99 | }, 100 | "_children": [], 101 | "_active": false, 102 | "_level": 2, 103 | "_components": [ 104 | { 105 | "__id__": 3 106 | }, 107 | { 108 | "__id__": 4 109 | } 110 | ], 111 | "_prefab": { 112 | "__id__": 5 113 | }, 114 | "_opacity": 255, 115 | "_color": { 116 | "__type__": "cc.Color", 117 | "r": 255, 118 | "g": 255, 119 | "b": 255, 120 | "a": 255 121 | }, 122 | "_contentSize": { 123 | "__type__": "cc.Size", 124 | "width": 58, 125 | "height": 40 126 | }, 127 | "_anchorPoint": { 128 | "__type__": "cc.Vec2", 129 | "x": 0.5, 130 | "y": 0.5 131 | }, 132 | "_position": { 133 | "__type__": "cc.Vec3", 134 | "x": -236, 135 | "y": 7, 136 | "z": 0 137 | }, 138 | "_scale": { 139 | "__type__": "cc.Vec3", 140 | "x": 1, 141 | "y": 1, 142 | "z": 1 143 | }, 144 | "_quat": { 145 | "__type__": "cc.Quat", 146 | "x": 0, 147 | "y": 0, 148 | "z": 0, 149 | "w": 1 150 | }, 151 | "_skewX": 0, 152 | "_skewY": 0, 153 | "_zIndex": 0, 154 | "_is3DNode": false, 155 | "groupIndex": 0, 156 | "_rotationX": 0, 157 | "_rotationY": 0, 158 | "_id": "" 159 | }, 160 | { 161 | "__type__": "cc.Label", 162 | "_name": "", 163 | "_objFlags": 0, 164 | "node": { 165 | "__id__": 2 166 | }, 167 | "_enabled": true, 168 | "_srcBlendFactor": 1, 169 | "_dstBlendFactor": 771, 170 | "_useOriginalSize": false, 171 | "_string": "???", 172 | "_N$string": "???", 173 | "_fontSize": 28, 174 | "_lineHeight": 40, 175 | "_enableWrapText": true, 176 | "_N$file": null, 177 | "_isSystemFontUsed": true, 178 | "_spacingX": 0, 179 | "_N$horizontalAlign": 1, 180 | "_N$verticalAlign": 1, 181 | "_N$fontFamily": "Arial", 182 | "_N$overflow": 2, 183 | "_id": "" 184 | }, 185 | { 186 | "__type__": "cc.LabelOutline", 187 | "_name": "", 188 | "_objFlags": 0, 189 | "node": { 190 | "__id__": 2 191 | }, 192 | "_enabled": true, 193 | "_color": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_width": 2, 201 | "_id": "" 202 | }, 203 | { 204 | "__type__": "cc.PrefabInfo", 205 | "root": { 206 | "__id__": 1 207 | }, 208 | "asset": { 209 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 210 | }, 211 | "fileId": "19sfsJ+CRC2bVmF3ulkD+e", 212 | "sync": false 213 | }, 214 | { 215 | "__type__": "cc.Node", 216 | "_name": "cup", 217 | "_objFlags": 0, 218 | "_parent": { 219 | "__id__": 1 220 | }, 221 | "_children": [], 222 | "_active": false, 223 | "_level": 2, 224 | "_components": [ 225 | { 226 | "__id__": 7 227 | } 228 | ], 229 | "_prefab": { 230 | "__id__": 8 231 | }, 232 | "_opacity": 255, 233 | "_color": { 234 | "__type__": "cc.Color", 235 | "r": 255, 236 | "g": 255, 237 | "b": 255, 238 | "a": 255 239 | }, 240 | "_contentSize": { 241 | "__type__": "cc.Size", 242 | "width": 61, 243 | "height": 50 244 | }, 245 | "_anchorPoint": { 246 | "__type__": "cc.Vec2", 247 | "x": 0.5, 248 | "y": 0.5 249 | }, 250 | "_position": { 251 | "__type__": "cc.Vec3", 252 | "x": -236, 253 | "y": 7, 254 | "z": 0 255 | }, 256 | "_scale": { 257 | "__type__": "cc.Vec3", 258 | "x": 1, 259 | "y": 1, 260 | "z": 1 261 | }, 262 | "_quat": { 263 | "__type__": "cc.Quat", 264 | "x": 0, 265 | "y": 0, 266 | "z": 0, 267 | "w": 1 268 | }, 269 | "_skewX": 0, 270 | "_skewY": 0, 271 | "_zIndex": 0, 272 | "_is3DNode": false, 273 | "groupIndex": 0, 274 | "_id": "" 275 | }, 276 | { 277 | "__type__": "cc.Sprite", 278 | "_name": "", 279 | "_objFlags": 0, 280 | "node": { 281 | "__id__": 6 282 | }, 283 | "_enabled": true, 284 | "_srcBlendFactor": 770, 285 | "_dstBlendFactor": 771, 286 | "_spriteFrame": null, 287 | "_type": 0, 288 | "_sizeMode": 1, 289 | "_fillType": 0, 290 | "_fillCenter": { 291 | "__type__": "cc.Vec2", 292 | "x": 0, 293 | "y": 0 294 | }, 295 | "_fillStart": 0, 296 | "_fillRange": 0, 297 | "_isTrimmedMode": true, 298 | "_state": 0, 299 | "_atlas": null, 300 | "_id": "" 301 | }, 302 | { 303 | "__type__": "cc.PrefabInfo", 304 | "root": { 305 | "__id__": 1 306 | }, 307 | "asset": { 308 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 309 | }, 310 | "fileId": "50utP4YPpDVLPsh+adgYbx", 311 | "sync": false 312 | }, 313 | { 314 | "__type__": "cc.Node", 315 | "_name": "head", 316 | "_objFlags": 0, 317 | "_parent": { 318 | "__id__": 1 319 | }, 320 | "_children": [], 321 | "_active": true, 322 | "_level": 2, 323 | "_components": [ 324 | { 325 | "__id__": 10 326 | } 327 | ], 328 | "_prefab": { 329 | "__id__": 11 330 | }, 331 | "_opacity": 255, 332 | "_color": { 333 | "__type__": "cc.Color", 334 | "r": 255, 335 | "g": 255, 336 | "b": 255, 337 | "a": 255 338 | }, 339 | "_contentSize": { 340 | "__type__": "cc.Size", 341 | "width": 72, 342 | "height": 72 343 | }, 344 | "_anchorPoint": { 345 | "__type__": "cc.Vec2", 346 | "x": 0.5, 347 | "y": 0.5 348 | }, 349 | "_position": { 350 | "__type__": "cc.Vec3", 351 | "x": -163, 352 | "y": 5, 353 | "z": 0 354 | }, 355 | "_scale": { 356 | "__type__": "cc.Vec3", 357 | "x": 1, 358 | "y": 1, 359 | "z": 1 360 | }, 361 | "_quat": { 362 | "__type__": "cc.Quat", 363 | "x": 0, 364 | "y": 0, 365 | "z": 0, 366 | "w": 1 367 | }, 368 | "_skewX": 0, 369 | "_skewY": 0, 370 | "_zIndex": 0, 371 | "_is3DNode": false, 372 | "groupIndex": 0, 373 | "_id": "" 374 | }, 375 | { 376 | "__type__": "cc.Sprite", 377 | "_name": "", 378 | "_objFlags": 0, 379 | "node": { 380 | "__id__": 9 381 | }, 382 | "_enabled": true, 383 | "_srcBlendFactor": 770, 384 | "_dstBlendFactor": 771, 385 | "_spriteFrame": { 386 | "__uuid__": "bd470dad-101b-4e56-9203-fd2e9d648d84" 387 | }, 388 | "_type": 0, 389 | "_sizeMode": 0, 390 | "_fillType": 0, 391 | "_fillCenter": { 392 | "__type__": "cc.Vec2", 393 | "x": 0, 394 | "y": 0 395 | }, 396 | "_fillStart": 0, 397 | "_fillRange": 0, 398 | "_isTrimmedMode": true, 399 | "_state": 0, 400 | "_atlas": null, 401 | "_id": "" 402 | }, 403 | { 404 | "__type__": "cc.PrefabInfo", 405 | "root": { 406 | "__id__": 1 407 | }, 408 | "asset": { 409 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 410 | }, 411 | "fileId": "17dIDaY5BERYWcOzl4TXWN", 412 | "sync": false 413 | }, 414 | { 415 | "__type__": "cc.Node", 416 | "_name": "name", 417 | "_objFlags": 0, 418 | "_parent": { 419 | "__id__": 1 420 | }, 421 | "_children": [], 422 | "_active": true, 423 | "_level": 2, 424 | "_components": [ 425 | { 426 | "__id__": 13 427 | } 428 | ], 429 | "_prefab": { 430 | "__id__": 14 431 | }, 432 | "_opacity": 255, 433 | "_color": { 434 | "__type__": "cc.Color", 435 | "r": 111, 436 | "g": 36, 437 | "b": 0, 438 | "a": 255 439 | }, 440 | "_contentSize": { 441 | "__type__": "cc.Size", 442 | "width": 240, 443 | "height": 40 444 | }, 445 | "_anchorPoint": { 446 | "__type__": "cc.Vec2", 447 | "x": 0, 448 | "y": 0.5 449 | }, 450 | "_position": { 451 | "__type__": "cc.Vec3", 452 | "x": -111, 453 | "y": 22, 454 | "z": 0 455 | }, 456 | "_scale": { 457 | "__type__": "cc.Vec3", 458 | "x": 1, 459 | "y": 1, 460 | "z": 1 461 | }, 462 | "_quat": { 463 | "__type__": "cc.Quat", 464 | "x": 0, 465 | "y": 0, 466 | "z": 0, 467 | "w": 1 468 | }, 469 | "_skewX": 0, 470 | "_skewY": 0, 471 | "_zIndex": 0, 472 | "_is3DNode": false, 473 | "groupIndex": 0, 474 | "_rotationX": 0, 475 | "_rotationY": 0, 476 | "_id": "" 477 | }, 478 | { 479 | "__type__": "cc.Label", 480 | "_name": "", 481 | "_objFlags": 0, 482 | "node": { 483 | "__id__": 12 484 | }, 485 | "_enabled": true, 486 | "_srcBlendFactor": 1, 487 | "_dstBlendFactor": 771, 488 | "_useOriginalSize": false, 489 | "_string": "???", 490 | "_N$string": "???", 491 | "_fontSize": 28, 492 | "_lineHeight": 40, 493 | "_enableWrapText": true, 494 | "_N$file": null, 495 | "_isSystemFontUsed": true, 496 | "_spacingX": 0, 497 | "_N$horizontalAlign": 0, 498 | "_N$verticalAlign": 1, 499 | "_N$fontFamily": "Arial", 500 | "_N$overflow": 2, 501 | "_id": "" 502 | }, 503 | { 504 | "__type__": "cc.PrefabInfo", 505 | "root": { 506 | "__id__": 1 507 | }, 508 | "asset": { 509 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 510 | }, 511 | "fileId": "05CORawgNN0ZEiPHOUXb07", 512 | "sync": false 513 | }, 514 | { 515 | "__type__": "cc.Node", 516 | "_name": "level", 517 | "_objFlags": 0, 518 | "_parent": { 519 | "__id__": 1 520 | }, 521 | "_children": [], 522 | "_active": true, 523 | "_level": 2, 524 | "_components": [ 525 | { 526 | "__id__": 16 527 | } 528 | ], 529 | "_prefab": { 530 | "__id__": 17 531 | }, 532 | "_opacity": 255, 533 | "_color": { 534 | "__type__": "cc.Color", 535 | "r": 128, 536 | "g": 147, 537 | "b": 131, 538 | "a": 255 539 | }, 540 | "_contentSize": { 541 | "__type__": "cc.Size", 542 | "width": 46.72, 543 | "height": 40 544 | }, 545 | "_anchorPoint": { 546 | "__type__": "cc.Vec2", 547 | "x": 0, 548 | "y": 0.5 549 | }, 550 | "_position": { 551 | "__type__": "cc.Vec3", 552 | "x": -111, 553 | "y": -16.5, 554 | "z": 0 555 | }, 556 | "_scale": { 557 | "__type__": "cc.Vec3", 558 | "x": 1, 559 | "y": 1, 560 | "z": 1 561 | }, 562 | "_quat": { 563 | "__type__": "cc.Quat", 564 | "x": 0, 565 | "y": 0, 566 | "z": 0, 567 | "w": 1 568 | }, 569 | "_skewX": 0, 570 | "_skewY": 0, 571 | "_zIndex": 0, 572 | "_is3DNode": false, 573 | "groupIndex": 0, 574 | "_rotationX": 0, 575 | "_rotationY": 0, 576 | "_id": "" 577 | }, 578 | { 579 | "__type__": "cc.Label", 580 | "_name": "", 581 | "_objFlags": 0, 582 | "node": { 583 | "__id__": 15 584 | }, 585 | "_enabled": true, 586 | "_srcBlendFactor": 1, 587 | "_dstBlendFactor": 771, 588 | "_useOriginalSize": false, 589 | "_string": "???", 590 | "_N$string": "???", 591 | "_fontSize": 28, 592 | "_lineHeight": 40, 593 | "_enableWrapText": true, 594 | "_N$file": null, 595 | "_isSystemFontUsed": true, 596 | "_spacingX": 0, 597 | "_N$horizontalAlign": 0, 598 | "_N$verticalAlign": 1, 599 | "_N$fontFamily": "Arial", 600 | "_N$overflow": 0, 601 | "_id": "" 602 | }, 603 | { 604 | "__type__": "cc.PrefabInfo", 605 | "root": { 606 | "__id__": 1 607 | }, 608 | "asset": { 609 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 610 | }, 611 | "fileId": "bbToYFzaFCpb09s6XNvUQd", 612 | "sync": false 613 | }, 614 | { 615 | "__type__": "cc.Node", 616 | "_name": "score", 617 | "_objFlags": 0, 618 | "_parent": { 619 | "__id__": 1 620 | }, 621 | "_children": [], 622 | "_active": true, 623 | "_level": 2, 624 | "_components": [ 625 | { 626 | "__id__": 19 627 | } 628 | ], 629 | "_prefab": { 630 | "__id__": 20 631 | }, 632 | "_opacity": 255, 633 | "_color": { 634 | "__type__": "cc.Color", 635 | "r": 169, 636 | "g": 125, 637 | "b": 62, 638 | "a": 255 639 | }, 640 | "_contentSize": { 641 | "__type__": "cc.Size", 642 | "width": 135.74, 643 | "height": 40 644 | }, 645 | "_anchorPoint": { 646 | "__type__": "cc.Vec2", 647 | "x": 0.5, 648 | "y": 0.5 649 | }, 650 | "_position": { 651 | "__type__": "cc.Vec3", 652 | "x": 199.7, 653 | "y": 5, 654 | "z": 0 655 | }, 656 | "_scale": { 657 | "__type__": "cc.Vec3", 658 | "x": 1, 659 | "y": 1, 660 | "z": 1 661 | }, 662 | "_quat": { 663 | "__type__": "cc.Quat", 664 | "x": 0, 665 | "y": 0, 666 | "z": 0, 667 | "w": 1 668 | }, 669 | "_skewX": 0, 670 | "_skewY": 0, 671 | "_zIndex": 0, 672 | "_is3DNode": false, 673 | "groupIndex": 0, 674 | "_rotationX": 0, 675 | "_rotationY": 0, 676 | "_id": "" 677 | }, 678 | { 679 | "__type__": "cc.Label", 680 | "_name": "", 681 | "_objFlags": 0, 682 | "node": { 683 | "__id__": 18 684 | }, 685 | "_enabled": true, 686 | "_srcBlendFactor": 1, 687 | "_dstBlendFactor": 771, 688 | "_useOriginalSize": false, 689 | "_string": "???", 690 | "_N$string": "???", 691 | "_fontSize": 28, 692 | "_lineHeight": 40, 693 | "_enableWrapText": true, 694 | "_N$file": null, 695 | "_isSystemFontUsed": true, 696 | "_spacingX": 0, 697 | "_N$horizontalAlign": 1, 698 | "_N$verticalAlign": 1, 699 | "_N$fontFamily": "Arial", 700 | "_N$overflow": 2, 701 | "_id": "" 702 | }, 703 | { 704 | "__type__": "cc.PrefabInfo", 705 | "root": { 706 | "__id__": 1 707 | }, 708 | "asset": { 709 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 710 | }, 711 | "fileId": "60Ryzd/+tJWolPaEpv29XB", 712 | "sync": false 713 | }, 714 | { 715 | "__type__": "cc.Sprite", 716 | "_name": "", 717 | "_objFlags": 0, 718 | "node": { 719 | "__id__": 1 720 | }, 721 | "_enabled": true, 722 | "_srcBlendFactor": 770, 723 | "_dstBlendFactor": 771, 724 | "_spriteFrame": { 725 | "__uuid__": "115c62dd-f619-4419-98cc-a9ffbc4182a4" 726 | }, 727 | "_type": 1, 728 | "_sizeMode": 0, 729 | "_fillType": 0, 730 | "_fillCenter": { 731 | "__type__": "cc.Vec2", 732 | "x": 0, 733 | "y": 0 734 | }, 735 | "_fillStart": 0, 736 | "_fillRange": 0, 737 | "_isTrimmedMode": true, 738 | "_state": 0, 739 | "_atlas": null, 740 | "_id": "" 741 | }, 742 | { 743 | "__type__": "cc.PrefabInfo", 744 | "root": { 745 | "__id__": 1 746 | }, 747 | "asset": { 748 | "__uuid__": "90e51498-af84-40d5-90eb-459340eb96b3" 749 | }, 750 | "fileId": "a5KV6A8ldNgrWRwODpCXe2", 751 | "sync": false 752 | } 753 | ] -------------------------------------------------------------------------------- /sub/assets/item.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "90e51498-af84-40d5-90eb-459340eb96b3", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /sub/assets/launch.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_active": true, 21 | "_level": 0, 22 | "_components": [], 23 | "_prefab": null, 24 | "_opacity": 255, 25 | "_color": { 26 | "__type__": "cc.Color", 27 | "r": 255, 28 | "g": 255, 29 | "b": 255, 30 | "a": 255 31 | }, 32 | "_contentSize": { 33 | "__type__": "cc.Size", 34 | "width": 0, 35 | "height": 0 36 | }, 37 | "_anchorPoint": { 38 | "__type__": "cc.Vec2", 39 | "x": 0, 40 | "y": 0 41 | }, 42 | "_scale": { 43 | "__type__": "cc.Vec3", 44 | "x": 0.3231821589205397, 45 | "y": 0.3231821589205397, 46 | "z": 0.3231821589205397 47 | }, 48 | "_quat": { 49 | "__type__": "cc.Quat", 50 | "x": 0, 51 | "y": 0, 52 | "z": 0, 53 | "w": 1 54 | }, 55 | "_zIndex": 0, 56 | "_is3DNode": true, 57 | "groupIndex": 0, 58 | "autoReleaseAssets": false, 59 | "_id": "e341aab9-e7dd-4dae-9c77-fdceeae1dc32" 60 | }, 61 | { 62 | "__type__": "cc.Node", 63 | "_name": "Canvas", 64 | "_objFlags": 0, 65 | "_parent": { 66 | "__id__": 1 67 | }, 68 | "_children": [ 69 | { 70 | "__id__": 3 71 | }, 72 | { 73 | "__id__": 5 74 | } 75 | ], 76 | "_active": true, 77 | "_level": 1, 78 | "_components": [ 79 | { 80 | "__id__": 25 81 | }, 82 | { 83 | "__id__": 26 84 | } 85 | ], 86 | "_prefab": null, 87 | "_opacity": 255, 88 | "_color": { 89 | "__type__": "cc.Color", 90 | "r": 255, 91 | "g": 255, 92 | "b": 255, 93 | "a": 255 94 | }, 95 | "_contentSize": { 96 | "__type__": "cc.Size", 97 | "width": 750, 98 | "height": 1334 99 | }, 100 | "_anchorPoint": { 101 | "__type__": "cc.Vec2", 102 | "x": 0.5, 103 | "y": 0.5 104 | }, 105 | "_position": { 106 | "__type__": "cc.Vec3", 107 | "x": 375, 108 | "y": 667, 109 | "z": 0 110 | }, 111 | "_scale": { 112 | "__type__": "cc.Vec3", 113 | "x": 1, 114 | "y": 1, 115 | "z": 1 116 | }, 117 | "_quat": { 118 | "__type__": "cc.Quat", 119 | "x": 0, 120 | "y": 0, 121 | "z": 0, 122 | "w": 1 123 | }, 124 | "_skewX": 0, 125 | "_skewY": 0, 126 | "_zIndex": 0, 127 | "_is3DNode": false, 128 | "groupIndex": 0, 129 | "_rotationX": 0, 130 | "_rotationY": 0, 131 | "_id": "0dVhcaGYNJ6anoCHEtU+NQ" 132 | }, 133 | { 134 | "__type__": "cc.Node", 135 | "_name": "Main Camera", 136 | "_objFlags": 0, 137 | "_parent": { 138 | "__id__": 2 139 | }, 140 | "_children": [], 141 | "_active": true, 142 | "_level": 2, 143 | "_components": [ 144 | { 145 | "__id__": 4 146 | } 147 | ], 148 | "_prefab": null, 149 | "_opacity": 255, 150 | "_color": { 151 | "__type__": "cc.Color", 152 | "r": 255, 153 | "g": 255, 154 | "b": 255, 155 | "a": 255 156 | }, 157 | "_contentSize": { 158 | "__type__": "cc.Size", 159 | "width": 0, 160 | "height": 0 161 | }, 162 | "_anchorPoint": { 163 | "__type__": "cc.Vec2", 164 | "x": 0.5, 165 | "y": 0.5 166 | }, 167 | "_position": { 168 | "__type__": "cc.Vec3", 169 | "x": 0, 170 | "y": 0, 171 | "z": 0 172 | }, 173 | "_scale": { 174 | "__type__": "cc.Vec3", 175 | "x": 1, 176 | "y": 1, 177 | "z": 1 178 | }, 179 | "_quat": { 180 | "__type__": "cc.Quat", 181 | "x": 0, 182 | "y": 0, 183 | "z": 0, 184 | "w": 1 185 | }, 186 | "_skewX": 0, 187 | "_skewY": 0, 188 | "_zIndex": 0, 189 | "_is3DNode": false, 190 | "groupIndex": 0, 191 | "_rotationX": 0, 192 | "_rotationY": 0, 193 | "_id": "cdmb5QpZxKZJg1+UVxfQ0k" 194 | }, 195 | { 196 | "__type__": "cc.Camera", 197 | "_name": "", 198 | "_objFlags": 0, 199 | "node": { 200 | "__id__": 3 201 | }, 202 | "_enabled": true, 203 | "_cullingMask": 4294967295, 204 | "_clearFlags": 7, 205 | "_backgroundColor": { 206 | "__type__": "cc.Color", 207 | "r": 0, 208 | "g": 0, 209 | "b": 0, 210 | "a": 0 211 | }, 212 | "_depth": -1, 213 | "_zoomRatio": 1, 214 | "_targetTexture": null, 215 | "_fov": 60, 216 | "_orthoSize": 10, 217 | "_nearClip": 0.1, 218 | "_farClip": 4096, 219 | "_ortho": true, 220 | "_rect": { 221 | "__type__": "cc.Rect", 222 | "x": 0, 223 | "y": 0, 224 | "width": 1, 225 | "height": 1 226 | }, 227 | "_id": "149Zg7t5hJUKjufmxYiVpD" 228 | }, 229 | { 230 | "__type__": "cc.Node", 231 | "_name": "rank-box", 232 | "_objFlags": 0, 233 | "_parent": { 234 | "__id__": 2 235 | }, 236 | "_children": [ 237 | { 238 | "__id__": 6 239 | }, 240 | { 241 | "__id__": 21 242 | }, 243 | { 244 | "__id__": 23 245 | } 246 | ], 247 | "_active": true, 248 | "_level": 2, 249 | "_components": [], 250 | "_prefab": null, 251 | "_opacity": 255, 252 | "_color": { 253 | "__type__": "cc.Color", 254 | "r": 255, 255 | "g": 255, 256 | "b": 255, 257 | "a": 255 258 | }, 259 | "_contentSize": { 260 | "__type__": "cc.Size", 261 | "width": 750, 262 | "height": 1334 263 | }, 264 | "_anchorPoint": { 265 | "__type__": "cc.Vec2", 266 | "x": 0.5, 267 | "y": 0.5 268 | }, 269 | "_position": { 270 | "__type__": "cc.Vec3", 271 | "x": 0, 272 | "y": 0, 273 | "z": 0 274 | }, 275 | "_scale": { 276 | "__type__": "cc.Vec3", 277 | "x": 1, 278 | "y": 1, 279 | "z": 1 280 | }, 281 | "_quat": { 282 | "__type__": "cc.Quat", 283 | "x": 0, 284 | "y": 0, 285 | "z": 0, 286 | "w": 1 287 | }, 288 | "_skewX": 0, 289 | "_skewY": 0, 290 | "_zIndex": 0, 291 | "_is3DNode": false, 292 | "groupIndex": 0, 293 | "_id": "96beTDjypCVJVp7Epjdehz" 294 | }, 295 | { 296 | "__type__": "cc.Node", 297 | "_name": "content", 298 | "_objFlags": 0, 299 | "_parent": { 300 | "__id__": 5 301 | }, 302 | "_children": [ 303 | { 304 | "__id__": 7 305 | } 306 | ], 307 | "_active": true, 308 | "_level": 3, 309 | "_components": [ 310 | { 311 | "__id__": 19 312 | }, 313 | { 314 | "__id__": 20 315 | } 316 | ], 317 | "_prefab": null, 318 | "_opacity": 255, 319 | "_color": { 320 | "__type__": "cc.Color", 321 | "r": 255, 322 | "g": 255, 323 | "b": 255, 324 | "a": 255 325 | }, 326 | "_contentSize": { 327 | "__type__": "cc.Size", 328 | "width": 580, 329 | "height": 600 330 | }, 331 | "_anchorPoint": { 332 | "__type__": "cc.Vec2", 333 | "x": 0.5, 334 | "y": 1 335 | }, 336 | "_position": { 337 | "__type__": "cc.Vec3", 338 | "x": 0, 339 | "y": 293, 340 | "z": 0 341 | }, 342 | "_scale": { 343 | "__type__": "cc.Vec3", 344 | "x": 1, 345 | "y": 1, 346 | "z": 1 347 | }, 348 | "_quat": { 349 | "__type__": "cc.Quat", 350 | "x": 0, 351 | "y": 0, 352 | "z": 0, 353 | "w": 1 354 | }, 355 | "_skewX": 0, 356 | "_skewY": 0, 357 | "_zIndex": 0, 358 | "_is3DNode": false, 359 | "groupIndex": 0, 360 | "_id": "26pNJuhktHoqz1QDkiNLmJ" 361 | }, 362 | { 363 | "__type__": "cc.Node", 364 | "_name": "item", 365 | "_objFlags": 0, 366 | "_parent": { 367 | "__id__": 6 368 | }, 369 | "_children": [ 370 | { 371 | "__id__": 8 372 | }, 373 | { 374 | "__id__": 10 375 | }, 376 | { 377 | "__id__": 12 378 | }, 379 | { 380 | "__id__": 14 381 | }, 382 | { 383 | "__id__": 16 384 | } 385 | ], 386 | "_active": true, 387 | "_level": 4, 388 | "_components": [ 389 | { 390 | "__id__": 18 391 | } 392 | ], 393 | "_prefab": null, 394 | "_opacity": 255, 395 | "_color": { 396 | "__type__": "cc.Color", 397 | "r": 255, 398 | "g": 255, 399 | "b": 255, 400 | "a": 255 401 | }, 402 | "_contentSize": { 403 | "__type__": "cc.Size", 404 | "width": 560, 405 | "height": 100 406 | }, 407 | "_anchorPoint": { 408 | "__type__": "cc.Vec2", 409 | "x": 0.5, 410 | "y": 0.5 411 | }, 412 | "_position": { 413 | "__type__": "cc.Vec3", 414 | "x": 0, 415 | "y": -60, 416 | "z": 0 417 | }, 418 | "_scale": { 419 | "__type__": "cc.Vec3", 420 | "x": 1, 421 | "y": 1, 422 | "z": 1 423 | }, 424 | "_quat": { 425 | "__type__": "cc.Quat", 426 | "x": 0, 427 | "y": 0, 428 | "z": 0, 429 | "w": 1 430 | }, 431 | "_skewX": 0, 432 | "_skewY": 0, 433 | "_zIndex": 0, 434 | "_is3DNode": false, 435 | "groupIndex": 0, 436 | "_id": "aa8WhJmKJE2JIX1beGUBnt" 437 | }, 438 | { 439 | "__type__": "cc.Node", 440 | "_name": "rank", 441 | "_objFlags": 0, 442 | "_parent": { 443 | "__id__": 7 444 | }, 445 | "_children": [], 446 | "_active": true, 447 | "_level": 5, 448 | "_components": [ 449 | { 450 | "__id__": 9 451 | } 452 | ], 453 | "_prefab": null, 454 | "_opacity": 255, 455 | "_color": { 456 | "__type__": "cc.Color", 457 | "r": 255, 458 | "g": 255, 459 | "b": 255, 460 | "a": 255 461 | }, 462 | "_contentSize": { 463 | "__type__": "cc.Size", 464 | "width": 37.82, 465 | "height": 60 466 | }, 467 | "_anchorPoint": { 468 | "__type__": "cc.Vec2", 469 | "x": 0.5, 470 | "y": 0.5 471 | }, 472 | "_position": { 473 | "__type__": "cc.Vec3", 474 | "x": -236, 475 | "y": 0, 476 | "z": 0 477 | }, 478 | "_scale": { 479 | "__type__": "cc.Vec3", 480 | "x": 1, 481 | "y": 1, 482 | "z": 1 483 | }, 484 | "_quat": { 485 | "__type__": "cc.Quat", 486 | "x": 0, 487 | "y": 0, 488 | "z": 0, 489 | "w": 1 490 | }, 491 | "_skewX": 0, 492 | "_skewY": 0, 493 | "_zIndex": 0, 494 | "_is3DNode": false, 495 | "groupIndex": 0, 496 | "_rotationX": 0, 497 | "_rotationY": 0, 498 | "_id": "12fKNBPs9GeLiAuXy0WZM0" 499 | }, 500 | { 501 | "__type__": "cc.Label", 502 | "_name": "", 503 | "_objFlags": 0, 504 | "node": { 505 | "__id__": 8 506 | }, 507 | "_enabled": true, 508 | "_srcBlendFactor": 1, 509 | "_dstBlendFactor": 771, 510 | "_useOriginalSize": false, 511 | "_string": "99", 512 | "_N$string": "99", 513 | "_fontSize": 34, 514 | "_lineHeight": 60, 515 | "_enableWrapText": true, 516 | "_N$file": null, 517 | "_isSystemFontUsed": true, 518 | "_spacingX": 0, 519 | "_N$horizontalAlign": 1, 520 | "_N$verticalAlign": 1, 521 | "_N$fontFamily": "Arial", 522 | "_N$overflow": 0, 523 | "_id": "20NVWrNAxN/owRxiNhEnLN" 524 | }, 525 | { 526 | "__type__": "cc.Node", 527 | "_name": "cup", 528 | "_objFlags": 0, 529 | "_parent": { 530 | "__id__": 7 531 | }, 532 | "_children": [], 533 | "_active": true, 534 | "_level": 5, 535 | "_components": [ 536 | { 537 | "__id__": 11 538 | } 539 | ], 540 | "_prefab": null, 541 | "_opacity": 255, 542 | "_color": { 543 | "__type__": "cc.Color", 544 | "r": 255, 545 | "g": 255, 546 | "b": 255, 547 | "a": 255 548 | }, 549 | "_contentSize": { 550 | "__type__": "cc.Size", 551 | "width": 42, 552 | "height": 71 553 | }, 554 | "_anchorPoint": { 555 | "__type__": "cc.Vec2", 556 | "x": 0.5, 557 | "y": 0.5 558 | }, 559 | "_position": { 560 | "__type__": "cc.Vec3", 561 | "x": -236, 562 | "y": 0, 563 | "z": 0 564 | }, 565 | "_scale": { 566 | "__type__": "cc.Vec3", 567 | "x": 1, 568 | "y": 1, 569 | "z": 1 570 | }, 571 | "_quat": { 572 | "__type__": "cc.Quat", 573 | "x": 0, 574 | "y": 0, 575 | "z": 0, 576 | "w": 1 577 | }, 578 | "_skewX": 0, 579 | "_skewY": 0, 580 | "_zIndex": 0, 581 | "_is3DNode": false, 582 | "groupIndex": 0, 583 | "_id": "0bkU+lSPFFD5enSCHqkCov" 584 | }, 585 | { 586 | "__type__": "cc.Sprite", 587 | "_name": "", 588 | "_objFlags": 0, 589 | "node": { 590 | "__id__": 10 591 | }, 592 | "_enabled": true, 593 | "_srcBlendFactor": 770, 594 | "_dstBlendFactor": 771, 595 | "_spriteFrame": null, 596 | "_type": 0, 597 | "_sizeMode": 1, 598 | "_fillType": 0, 599 | "_fillCenter": { 600 | "__type__": "cc.Vec2", 601 | "x": 0, 602 | "y": 0 603 | }, 604 | "_fillStart": 0, 605 | "_fillRange": 0, 606 | "_isTrimmedMode": true, 607 | "_state": 0, 608 | "_atlas": null, 609 | "_id": "69jB9lfutINaD1+s5t3nXT" 610 | }, 611 | { 612 | "__type__": "cc.Node", 613 | "_name": "head", 614 | "_objFlags": 0, 615 | "_parent": { 616 | "__id__": 7 617 | }, 618 | "_children": [], 619 | "_active": true, 620 | "_level": 5, 621 | "_components": [ 622 | { 623 | "__id__": 13 624 | } 625 | ], 626 | "_prefab": null, 627 | "_opacity": 255, 628 | "_color": { 629 | "__type__": "cc.Color", 630 | "r": 255, 631 | "g": 255, 632 | "b": 255, 633 | "a": 255 634 | }, 635 | "_contentSize": { 636 | "__type__": "cc.Size", 637 | "width": 72, 638 | "height": 72 639 | }, 640 | "_anchorPoint": { 641 | "__type__": "cc.Vec2", 642 | "x": 0.5, 643 | "y": 0.5 644 | }, 645 | "_position": { 646 | "__type__": "cc.Vec3", 647 | "x": -150, 648 | "y": 0, 649 | "z": 0 650 | }, 651 | "_scale": { 652 | "__type__": "cc.Vec3", 653 | "x": 1, 654 | "y": 1, 655 | "z": 1 656 | }, 657 | "_quat": { 658 | "__type__": "cc.Quat", 659 | "x": 0, 660 | "y": 0, 661 | "z": 0, 662 | "w": 1 663 | }, 664 | "_skewX": 0, 665 | "_skewY": 0, 666 | "_zIndex": 0, 667 | "_is3DNode": false, 668 | "groupIndex": 0, 669 | "_id": "e4vU1HcUxL95bWnUSuSLDM" 670 | }, 671 | { 672 | "__type__": "cc.Sprite", 673 | "_name": "", 674 | "_objFlags": 0, 675 | "node": { 676 | "__id__": 12 677 | }, 678 | "_enabled": true, 679 | "_srcBlendFactor": 770, 680 | "_dstBlendFactor": 771, 681 | "_spriteFrame": { 682 | "__uuid__": "423f090d-2eae-43ec-8faa-9531af528b8c" 683 | }, 684 | "_type": 0, 685 | "_sizeMode": 0, 686 | "_fillType": 0, 687 | "_fillCenter": { 688 | "__type__": "cc.Vec2", 689 | "x": 0, 690 | "y": 0 691 | }, 692 | "_fillStart": 0, 693 | "_fillRange": 0, 694 | "_isTrimmedMode": true, 695 | "_state": 0, 696 | "_atlas": null, 697 | "_id": "06hEiUz69JGL+fYGhPDP6V" 698 | }, 699 | { 700 | "__type__": "cc.Node", 701 | "_name": "name", 702 | "_objFlags": 0, 703 | "_parent": { 704 | "__id__": 7 705 | }, 706 | "_children": [], 707 | "_active": true, 708 | "_level": 5, 709 | "_components": [ 710 | { 711 | "__id__": 15 712 | } 713 | ], 714 | "_prefab": null, 715 | "_opacity": 255, 716 | "_color": { 717 | "__type__": "cc.Color", 718 | "r": 255, 719 | "g": 255, 720 | "b": 255, 721 | "a": 255 722 | }, 723 | "_contentSize": { 724 | "__type__": "cc.Size", 725 | "width": 200, 726 | "height": 60 727 | }, 728 | "_anchorPoint": { 729 | "__type__": "cc.Vec2", 730 | "x": 0.5, 731 | "y": 0.5 732 | }, 733 | "_position": { 734 | "__type__": "cc.Vec3", 735 | "x": 0, 736 | "y": 0, 737 | "z": 0 738 | }, 739 | "_scale": { 740 | "__type__": "cc.Vec3", 741 | "x": 1, 742 | "y": 1, 743 | "z": 1 744 | }, 745 | "_quat": { 746 | "__type__": "cc.Quat", 747 | "x": 0, 748 | "y": 0, 749 | "z": 0, 750 | "w": 1 751 | }, 752 | "_skewX": 0, 753 | "_skewY": 0, 754 | "_zIndex": 0, 755 | "_is3DNode": false, 756 | "groupIndex": 0, 757 | "_rotationX": 0, 758 | "_rotationY": 0, 759 | "_id": "8aOywRMp1DaIDvqHsnR70f" 760 | }, 761 | { 762 | "__type__": "cc.Label", 763 | "_name": "", 764 | "_objFlags": 0, 765 | "node": { 766 | "__id__": 14 767 | }, 768 | "_enabled": true, 769 | "_srcBlendFactor": 1, 770 | "_dstBlendFactor": 771, 771 | "_useOriginalSize": false, 772 | "_string": "name", 773 | "_N$string": "name", 774 | "_fontSize": 28, 775 | "_lineHeight": 60, 776 | "_enableWrapText": true, 777 | "_N$file": null, 778 | "_isSystemFontUsed": true, 779 | "_spacingX": 0, 780 | "_N$horizontalAlign": 1, 781 | "_N$verticalAlign": 1, 782 | "_N$fontFamily": "Arial", 783 | "_N$overflow": 2, 784 | "_id": "80+uismrlDxb0hA9Uiyp7r" 785 | }, 786 | { 787 | "__type__": "cc.Node", 788 | "_name": "score", 789 | "_objFlags": 0, 790 | "_parent": { 791 | "__id__": 7 792 | }, 793 | "_children": [], 794 | "_active": true, 795 | "_level": 5, 796 | "_components": [ 797 | { 798 | "__id__": 17 799 | } 800 | ], 801 | "_prefab": null, 802 | "_opacity": 255, 803 | "_color": { 804 | "__type__": "cc.Color", 805 | "r": 255, 806 | "g": 255, 807 | "b": 255, 808 | "a": 255 809 | }, 810 | "_contentSize": { 811 | "__type__": "cc.Size", 812 | "width": 160, 813 | "height": 60 814 | }, 815 | "_anchorPoint": { 816 | "__type__": "cc.Vec2", 817 | "x": 0.5, 818 | "y": 0.5 819 | }, 820 | "_position": { 821 | "__type__": "cc.Vec3", 822 | "x": 191, 823 | "y": 0, 824 | "z": 0 825 | }, 826 | "_scale": { 827 | "__type__": "cc.Vec3", 828 | "x": 1, 829 | "y": 1, 830 | "z": 1 831 | }, 832 | "_quat": { 833 | "__type__": "cc.Quat", 834 | "x": 0, 835 | "y": 0, 836 | "z": 0, 837 | "w": 1 838 | }, 839 | "_skewX": 0, 840 | "_skewY": 0, 841 | "_zIndex": 0, 842 | "_is3DNode": false, 843 | "groupIndex": 0, 844 | "_rotationX": 0, 845 | "_rotationY": 0, 846 | "_id": "d6ep9yJ9BKNa4l+Nce8s1C" 847 | }, 848 | { 849 | "__type__": "cc.Label", 850 | "_name": "", 851 | "_objFlags": 0, 852 | "node": { 853 | "__id__": 16 854 | }, 855 | "_enabled": true, 856 | "_srcBlendFactor": 1, 857 | "_dstBlendFactor": 771, 858 | "_useOriginalSize": false, 859 | "_string": "999", 860 | "_N$string": "999", 861 | "_fontSize": 28, 862 | "_lineHeight": 60, 863 | "_enableWrapText": true, 864 | "_N$file": null, 865 | "_isSystemFontUsed": true, 866 | "_spacingX": 0, 867 | "_N$horizontalAlign": 1, 868 | "_N$verticalAlign": 1, 869 | "_N$fontFamily": "Arial", 870 | "_N$overflow": 2, 871 | "_id": "03ehNxSzpFlLlgUXbZthJN" 872 | }, 873 | { 874 | "__type__": "cc.Sprite", 875 | "_name": "", 876 | "_objFlags": 0, 877 | "node": { 878 | "__id__": 7 879 | }, 880 | "_enabled": true, 881 | "_srcBlendFactor": 770, 882 | "_dstBlendFactor": 771, 883 | "_spriteFrame": { 884 | "__uuid__": "3e4a6f00-6359-428b-b8a2-ad80a839203a" 885 | }, 886 | "_type": 0, 887 | "_sizeMode": 0, 888 | "_fillType": 0, 889 | "_fillCenter": { 890 | "__type__": "cc.Vec2", 891 | "x": 0, 892 | "y": 0 893 | }, 894 | "_fillStart": 0, 895 | "_fillRange": 0, 896 | "_isTrimmedMode": true, 897 | "_state": 0, 898 | "_atlas": null, 899 | "_id": "8aF0hGbJZFqYm1wb9Jn21S" 900 | }, 901 | { 902 | "__type__": "cc.Sprite", 903 | "_name": "", 904 | "_objFlags": 0, 905 | "node": { 906 | "__id__": 6 907 | }, 908 | "_enabled": true, 909 | "_srcBlendFactor": 770, 910 | "_dstBlendFactor": 771, 911 | "_spriteFrame": { 912 | "__uuid__": "567cadd7-aa73-4642-bbb2-df28d65309c4" 913 | }, 914 | "_type": 1, 915 | "_sizeMode": 0, 916 | "_fillType": 0, 917 | "_fillCenter": { 918 | "__type__": "cc.Vec2", 919 | "x": 0, 920 | "y": 0 921 | }, 922 | "_fillStart": 0, 923 | "_fillRange": 0, 924 | "_isTrimmedMode": true, 925 | "_state": 0, 926 | "_atlas": null, 927 | "_id": "61c5lhSH5E7Lz7G8g3X7lU" 928 | }, 929 | { 930 | "__type__": "cc.Layout", 931 | "_name": "", 932 | "_objFlags": 0, 933 | "node": { 934 | "__id__": 6 935 | }, 936 | "_enabled": true, 937 | "_layoutSize": { 938 | "__type__": "cc.Size", 939 | "width": 300, 940 | "height": 200 941 | }, 942 | "_resize": 0, 943 | "_N$layoutType": 2, 944 | "_N$padding": 0, 945 | "_N$cellSize": { 946 | "__type__": "cc.Size", 947 | "width": 40, 948 | "height": 40 949 | }, 950 | "_N$startAxis": 0, 951 | "_N$paddingLeft": 10, 952 | "_N$paddingRight": 0, 953 | "_N$paddingTop": 10, 954 | "_N$paddingBottom": 0, 955 | "_N$spacingX": 10, 956 | "_N$spacingY": 10, 957 | "_N$verticalDirection": 1, 958 | "_N$horizontalDirection": 0, 959 | "_N$affectedByScale": false, 960 | "_id": "c8/uRi/LtBv4n+EgvA943N" 961 | }, 962 | { 963 | "__type__": "cc.Node", 964 | "_name": "page-label", 965 | "_objFlags": 0, 966 | "_parent": { 967 | "__id__": 5 968 | }, 969 | "_children": [], 970 | "_active": true, 971 | "_level": 3, 972 | "_components": [ 973 | { 974 | "__id__": 22 975 | } 976 | ], 977 | "_prefab": null, 978 | "_opacity": 255, 979 | "_color": { 980 | "__type__": "cc.Color", 981 | "r": 255, 982 | "g": 192, 983 | "b": 0, 984 | "a": 255 985 | }, 986 | "_contentSize": { 987 | "__type__": "cc.Size", 988 | "width": 100.1, 989 | "height": 60 990 | }, 991 | "_anchorPoint": { 992 | "__type__": "cc.Vec2", 993 | "x": 0.5, 994 | "y": 0.5 995 | }, 996 | "_position": { 997 | "__type__": "cc.Vec3", 998 | "x": 0, 999 | "y": -355, 1000 | "z": 0 1001 | }, 1002 | "_scale": { 1003 | "__type__": "cc.Vec3", 1004 | "x": 1, 1005 | "y": 1, 1006 | "z": 1 1007 | }, 1008 | "_quat": { 1009 | "__type__": "cc.Quat", 1010 | "x": 0, 1011 | "y": 0, 1012 | "z": 0, 1013 | "w": 1 1014 | }, 1015 | "_skewX": 0, 1016 | "_skewY": 0, 1017 | "_zIndex": 0, 1018 | "_is3DNode": false, 1019 | "groupIndex": 0, 1020 | "_rotationX": 0, 1021 | "_rotationY": 0, 1022 | "_id": "89LYUBeu9KvJjK8+BnawQu" 1023 | }, 1024 | { 1025 | "__type__": "cc.Label", 1026 | "_name": "", 1027 | "_objFlags": 0, 1028 | "node": { 1029 | "__id__": 21 1030 | }, 1031 | "_enabled": true, 1032 | "_srcBlendFactor": 1, 1033 | "_dstBlendFactor": 771, 1034 | "_useOriginalSize": false, 1035 | "_string": "99/99", 1036 | "_N$string": "99/99", 1037 | "_fontSize": 40, 1038 | "_lineHeight": 60, 1039 | "_enableWrapText": true, 1040 | "_N$file": null, 1041 | "_isSystemFontUsed": true, 1042 | "_spacingX": 0, 1043 | "_N$horizontalAlign": 1, 1044 | "_N$verticalAlign": 1, 1045 | "_N$fontFamily": "Arial", 1046 | "_N$overflow": 0, 1047 | "_id": "9ezCiv83dG94PeOCZhxnrU" 1048 | }, 1049 | { 1050 | "__type__": "cc.Node", 1051 | "_name": "tip", 1052 | "_objFlags": 0, 1053 | "_parent": { 1054 | "__id__": 5 1055 | }, 1056 | "_children": [], 1057 | "_active": true, 1058 | "_level": 3, 1059 | "_components": [ 1060 | { 1061 | "__id__": 24 1062 | } 1063 | ], 1064 | "_prefab": null, 1065 | "_opacity": 255, 1066 | "_color": { 1067 | "__type__": "cc.Color", 1068 | "r": 255, 1069 | "g": 255, 1070 | "b": 255, 1071 | "a": 255 1072 | }, 1073 | "_contentSize": { 1074 | "__type__": "cc.Size", 1075 | "width": 120.89, 1076 | "height": 40 1077 | }, 1078 | "_anchorPoint": { 1079 | "__type__": "cc.Vec2", 1080 | "x": 0.5, 1081 | "y": 0.5 1082 | }, 1083 | "_position": { 1084 | "__type__": "cc.Vec3", 1085 | "x": 0, 1086 | "y": 0, 1087 | "z": 0 1088 | }, 1089 | "_scale": { 1090 | "__type__": "cc.Vec3", 1091 | "x": 1, 1092 | "y": 1, 1093 | "z": 1 1094 | }, 1095 | "_quat": { 1096 | "__type__": "cc.Quat", 1097 | "x": 0, 1098 | "y": 0, 1099 | "z": 0, 1100 | "w": 1 1101 | }, 1102 | "_skewX": 0, 1103 | "_skewY": 0, 1104 | "_zIndex": 0, 1105 | "_is3DNode": false, 1106 | "groupIndex": 0, 1107 | "_rotationX": 0, 1108 | "_rotationY": 0, 1109 | "_id": "e2wtVN3YdBv7TkNKPssKNU" 1110 | }, 1111 | { 1112 | "__type__": "cc.Label", 1113 | "_name": "", 1114 | "_objFlags": 0, 1115 | "node": { 1116 | "__id__": 23 1117 | }, 1118 | "_enabled": true, 1119 | "_srcBlendFactor": 1, 1120 | "_dstBlendFactor": 771, 1121 | "_useOriginalSize": false, 1122 | "_string": "加载中..", 1123 | "_N$string": "加载中..", 1124 | "_fontSize": 34, 1125 | "_lineHeight": 40, 1126 | "_enableWrapText": true, 1127 | "_N$file": null, 1128 | "_isSystemFontUsed": true, 1129 | "_spacingX": 0, 1130 | "_N$horizontalAlign": 1, 1131 | "_N$verticalAlign": 1, 1132 | "_N$fontFamily": "Arial", 1133 | "_N$overflow": 0, 1134 | "_id": "18sE4tVyhHpLmjljTxKZHy" 1135 | }, 1136 | { 1137 | "__type__": "cc.Canvas", 1138 | "_name": "", 1139 | "_objFlags": 0, 1140 | "node": { 1141 | "__id__": 2 1142 | }, 1143 | "_enabled": true, 1144 | "_designResolution": { 1145 | "__type__": "cc.Size", 1146 | "width": 750, 1147 | "height": 1334 1148 | }, 1149 | "_fitWidth": false, 1150 | "_fitHeight": false, 1151 | "_id": "03pnmsuulMP6LSg6rjp5Tz" 1152 | }, 1153 | { 1154 | "__type__": "c7a65EfzYlEAIg1k5DnwHDc", 1155 | "_name": "", 1156 | "_objFlags": 0, 1157 | "node": { 1158 | "__id__": 2 1159 | }, 1160 | "_enabled": true, 1161 | "rankBox": { 1162 | "__id__": 5 1163 | }, 1164 | "itemNumber": 5, 1165 | "cupImg": [ 1166 | { 1167 | "__uuid__": "6cab0475-e602-4b47-97a8-02fa948397ce" 1168 | }, 1169 | { 1170 | "__uuid__": "f237c06a-fa82-4876-9fe0-8901a28bb895" 1171 | }, 1172 | { 1173 | "__uuid__": "a8686559-f74e-4807-a808-d0a8eff599f0" 1174 | } 1175 | ], 1176 | "_id": "f37ucruyJDM5FmZEDN5LLF" 1177 | } 1178 | ] -------------------------------------------------------------------------------- /sub/assets/launch.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "e341aab9-e7dd-4dae-9c77-fdceeae1dc32", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /sub/assets/launch.js: -------------------------------------------------------------------------------- 1 | /** 子域主程序脚本 这里我不用 ES6 因为如果在开发者工具中不勾选 ES6 转 ES5 的话会导致子域报错 */ 2 | cc.Class({ 3 | extends: cc.Component, 4 | 5 | properties: { 6 | rankBox: { 7 | default: null, 8 | type: cc.Node, 9 | displayName: '整体界面' 10 | }, 11 | itemNumber: { 12 | default: 5, 13 | displayName: 'item数量' 14 | }, 15 | cupImg: { 16 | default: [], 17 | type: cc.SpriteFrame, 18 | displayName: '奖杯图片' 19 | }, 20 | }, 21 | 22 | /** 23 | * 加载图片 24 | * @param {cc.Node} node 节点 25 | * @param {string} src 路径 26 | */ 27 | loadImg: function (node, src) { 28 | if (!src) return; 29 | var image = wx.createImage(); 30 | image.onload = function () { 31 | var texture = new cc.Texture2D(); 32 | texture.initWithElement(image); 33 | texture.handleLoadedTexture(); 34 | var frame = new cc.SpriteFrame(texture); 35 | node.getComponent(cc.Sprite).spriteFrame = frame; 36 | } 37 | image.src = src; 38 | }, 39 | 40 | /** 41 | * 获取图片缓存 42 | * @param {number} index 索引 43 | * @param {string } src 路径 44 | */ 45 | createImage: function(index, src) { 46 | if (!src) return null; 47 | var THAT = this; 48 | var image = wx.createImage(); 49 | image.onload = function () { 50 | var texture = new cc.Texture2D(); 51 | texture.initWithElement(image); 52 | texture.handleLoadedTexture(); 53 | var frame = new cc.SpriteFrame(texture); 54 | THAT.rank_list[index].spriteFrame = frame; 55 | } 56 | image.src = src; 57 | }, 58 | 59 | // 下一页 60 | nextPage: function () { 61 | if (this.page >= this.page_max - 1) return; 62 | this.page += 1; 63 | this.updateItem(); 64 | }, 65 | 66 | // 上一页 67 | previousPage: function () { 68 | if (this.page == 0) return; 69 | this.page -= 1; 70 | this.updateItem(); 71 | }, 72 | 73 | // 更新item 74 | updateItem: function () { 75 | var THAT = this; 76 | /** 排行榜列表 */ 77 | var list = this.rank_list; 78 | // console.log('排行榜列表', list); 79 | // 遍历更新 80 | this.item_box.children.forEach(function (item, i) { 81 | /** 排名 */ 82 | var index = THAT.page * THAT.itemNumber + i; 83 | if (list[index]) { 84 | item.active = true; 85 | /** 排名 */ 86 | var rank = cc.find('rank', item).getComponent(cc.Label); 87 | /** 奖杯 */ 88 | var cup = cc.find('cup', item).getComponent(cc.Sprite); 89 | /** 用户头像 */ 90 | var head = cc.find('head', item).getComponent(cc.Sprite); 91 | /** 用户名 */ 92 | var name = cc.find('name', item).getComponent(cc.Label); 93 | /** 分数 */ 94 | var score = cc.find('score', item).getComponent(cc.Label); 95 | // 排名 96 | if (index < 3) { 97 | cup.node.active = true; 98 | cup.spriteFrame = THAT.cupImg[index]; 99 | rank.node.active = false; 100 | } else { 101 | cup.node.active = false; 102 | rank.node.active = true; 103 | rank.string = index + 1; 104 | } 105 | // 头像 106 | // if (list[index].avatarUrl) { 107 | // THAT.loadImg(head.node, list[index].avatarUrl); 108 | // } else { 109 | // head.spriteFrame = THAT.default_head; 110 | // } 111 | head.spriteFrame = list[index].spriteFrame; 112 | name.string = list[index].nickName; 113 | score.string = list[index].score; 114 | } else { 115 | item.active = false; 116 | } 117 | }); 118 | // 判断有无数据 119 | if (this.rank_list.length == 0) { 120 | this.none_data.active = true; 121 | this.none_data.getComponent(cc.Label).string = '暂无数据...'; 122 | this.page_label.string = '--/--'; 123 | } else { 124 | this.none_data.active = false; 125 | this.page_label.string = this.page + 1 + '/' + this.page_max; 126 | } 127 | }, 128 | 129 | // 初始化 130 | init: function () { 131 | /** item容器 */ 132 | this.item_box = cc.find('content', this.rankBox); 133 | /** 页数label */ 134 | this.page_label = cc.find('page-label', this.rankBox).getComponent(cc.Label); 135 | /** 暂无数据提示 */ 136 | this.none_data = cc.find('tip', this.rankBox); 137 | /** 首个item */ 138 | var item = cc.find('item', this.item_box); 139 | /** item预制体 */ 140 | var prefab = cc.instantiate(item); 141 | /** 默认头像 */ 142 | this.default_head = cc.find('head', item).getComponent(cc.Sprite).spriteFrame; 143 | for (var i = 1; i < this.itemNumber; i++) { 144 | const item = cc.instantiate(prefab); 145 | item.parent = this.item_box; 146 | } 147 | }, 148 | 149 | /** 150 | * 格式化数据 151 | * @param {Array} data 数组 152 | * @param {object} slef 个人数据 153 | */ 154 | formatList: function (data, slef) { 155 | var list = [], slefData = null; 156 | var THAT = this; 157 | // 整理数据(所有排行数据) 158 | list = data.map(function (item) { 159 | var KVD = null; 160 | 161 | if (item.KVDataList.length) { 162 | KVD = JSON.parse(item.KVDataList.filter(function (list) { return list.key === 'all' })[0].value); 163 | } else { 164 | KVD = { 165 | wxgame: { 166 | score: 0, 167 | update_time: 0 168 | } 169 | } 170 | } 171 | 172 | return { 173 | openid: item.openid, 174 | nickName: item.nickname, // 注意这里微信返回的是小写 n 175 | avatarUrl: item.avatarUrl, 176 | score: KVD.wxgame.score, 177 | update_time: KVD.wxgame.update_time, 178 | spriteFrame: THAT.default_head 179 | } 180 | }); 181 | 182 | list.sort(function (a, b) { 183 | return b.score - a.score; 184 | }); 185 | 186 | // list = data.map(item => { 187 | // var KVD = JSON.parse(item.KVDataList.filter(list => list.key === 'all')[0].value); 188 | // return { 189 | // openid: item.openid, 190 | // nickName: item.nickname, // 注意这里微信返回的是小写 n 191 | // avatarUrl: item.avatarUrl, 192 | // score: KVD.wxgame.score, 193 | // update_time: KVD.wxgame.update_time, 194 | // } 195 | // }); 196 | 197 | // list.sort((a, b) => b - a); 198 | 199 | for (var i = 0; i < list.length; i++) { 200 | if (list[i].nickName == slef.nickName && list[i].avatarUrl == slef.avatarUrl) { 201 | slefData = list[i]; 202 | slefData.index = i; 203 | break; 204 | } 205 | 206 | } 207 | 208 | // 更新排行榜数据 209 | this.rank_list = list; 210 | // 这里把所有图片加载出来并缓存 211 | for (var i = 0; i < list.length; i++) { 212 | this.createImage(i, list[i].avatarUrl); 213 | } 214 | // 页数重置为 0 215 | this.page = 0; 216 | // 最大页数 217 | this.page_max = Math.ceil(this.rank_list.length / this.itemNumber); 218 | // console.log('子域 排行榜列表 ==============>', THAT.rank_list); 219 | }, 220 | 221 | /** 获取数据并生成内容 */ 222 | getData: function () { 223 | if (this.compareVersion('1.9.92') < 0) return; 224 | var THAT = this; 225 | wx.getUserInfo({ 226 | openIdList: ['selfOpenId'], 227 | success: function (res) { 228 | if (res.errMsg != 'getUserInfo:ok') return; 229 | var self = res.data[0]; 230 | // 获取微信数据 231 | wx.getFriendCloudStorage({ 232 | keyList: ['all'], 233 | success: function (res) { 234 | /** 格式化后的数据 */ 235 | THAT.formatList(res.data, self); 236 | }, 237 | fail: function (err) { 238 | console.warn('子域 获取微信数据失败', err); 239 | } 240 | }); 241 | }, 242 | fail: function (err) { 243 | console.warn('子域 获取用户信息失败', err); 244 | } 245 | }); 246 | }, 247 | 248 | /** 249 | * 上传分数 发送过来的数据 250 | * @param {string} score 251 | */ 252 | postScore: function (score) { 253 | if (this.compareVersion('1.9.92') < 0) return; 254 | 255 | /** 上传到微信服务器 */ 256 | function postWeChat() { 257 | var kvDataValue = { 258 | wxgame: { 259 | score: score, 260 | update_time: parseInt(new Date().getTime() / 1000), 261 | } 262 | }; 263 | var kvData = { 264 | key: 'all', 265 | value: JSON.stringify(kvDataValue) 266 | }; 267 | wx.setUserCloudStorage({ 268 | KVDataList: [kvData], 269 | success: function (res) { 270 | console.log('设置子域数据成功 >>', res); 271 | } 272 | }); 273 | }; 274 | 275 | // 获取存储数据 276 | wx.getUserCloudStorage({ 277 | keyList: ['all'], 278 | success: function (res) { 279 | // console.log('获得分数数据:', res) 280 | if (res.errMsg != 'getUserCloudStorage:ok') return; 281 | if (res.KVDataList.length == 0) return postWeChat(); 282 | var rankData = JSON.parse(res.KVDataList[0].value); 283 | 284 | // 微信服务器数据 285 | var wx_score = rankData.wxgame.score ? rankData.wxgame.score : null; 286 | 287 | if (wx_score == null) { 288 | postWeChat(); 289 | } else if (score > wx_score) { 290 | postWeChat(); 291 | } 292 | } 293 | }); 294 | }, 295 | 296 | /** 297 | * 对比版本 298 | * @param {string} v2 对比的版本 299 | */ 300 | compareVersion: function (v2) { 301 | /** 当前版本号 */ 302 | var ver = wx.getSystemInfoSync().SDKVersion; 303 | var v1 = ver.split('.'); 304 | v2 = v2.split('.'); 305 | var len = Math.max(v1.length, v2.length); 306 | 307 | while (v1.length < len) { 308 | v1.push('0'); 309 | } 310 | while (v2.length < len) { 311 | v2.push('0'); 312 | } 313 | for (var i = 0; i < len; i++) { 314 | var num1 = parseInt(v1[i]); 315 | var num2 = parseInt(v2[i]); 316 | 317 | if (num1 > num2) { 318 | return 1; 319 | } else if (num1 < num2) { 320 | return -1; 321 | } 322 | } 323 | return 0; 324 | }, 325 | 326 | // LIFE-CYCLE CALLBACKS: 327 | 328 | onLoad: function () { 329 | this.page = 0; 330 | this.page_max = 0; 331 | this.rank_list = []; 332 | this.init(); 333 | // this.updateItem(); 334 | }, 335 | 336 | start: function () { 337 | var THAT = this; 338 | // THAT.log('微信子域执行'); 339 | // 监听显示 340 | if (window.wx) { 341 | wx.onMessage(function (data) { 342 | var text = data.action; 343 | // console.log('子域传参', text); 344 | switch (text) { 345 | case 'uploadScore': 346 | // 上传分数 347 | THAT.postScore(data.score); 348 | break; 349 | 350 | case 'update': 351 | THAT.getData(); 352 | break; 353 | 354 | case 'show': 355 | THAT.rankBox.active = true; 356 | THAT.updateItem(); 357 | break; 358 | 359 | case 'hide': 360 | THAT.rankBox.active = false; 361 | break; 362 | 363 | case 'next': 364 | THAT.nextPage(); 365 | break; 366 | 367 | case 'previous': 368 | THAT.previousPage(); 369 | break; 370 | } 371 | }); 372 | this.getData(); 373 | } 374 | }, 375 | 376 | // update (dt) {}, 377 | }); 378 | -------------------------------------------------------------------------------- /sub/assets/launch.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "c7a6511f-cd89-4400-8835-9390e7c070dc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /sub/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /sub/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /sub/settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "android-instant": { 3 | "REMOTE_SERVER_ROOT": "", 4 | "host": "", 5 | "pathPattern": "", 6 | "recordPath": "", 7 | "scheme": "https", 8 | "skipRecord": false 9 | }, 10 | "appKey": "", 11 | "appSecret": "", 12 | "encryptJs": true, 13 | "excludeScenes": [], 14 | "fb-instant-games": {}, 15 | "includeAnySDK": false, 16 | "includeSDKBox": false, 17 | "inlineSpriteFrames": true, 18 | "inlineSpriteFrames_native": true, 19 | "jailbreakPlatform": false, 20 | "md5Cache": true, 21 | "mergeStartScene": false, 22 | "oauthLoginServer": "", 23 | "optimizeHotUpdate": false, 24 | "orientation": { 25 | "landscapeLeft": true, 26 | "landscapeRight": true, 27 | "portrait": false, 28 | "upsideDown": false 29 | }, 30 | "packageName": "org.cocos2d.sub", 31 | "privateKey": "", 32 | "qqplay": { 33 | "REMOTE_SERVER_ROOT": "", 34 | "orientation": "portrait", 35 | "zip": false 36 | }, 37 | "startScene": "e341aab9-e7dd-4dae-9c77-fdceeae1dc32", 38 | "title": "sub", 39 | "webOrientation": "auto", 40 | "wechatgame": { 41 | "REMOTE_SERVER_ROOT": "", 42 | "appid": "wx6ac3f5090a6b99c5", 43 | "orientation": "portrait", 44 | "subContext": "" 45 | }, 46 | "xxteaKey": "b5c447c0-fa6d-40", 47 | "zipCompressJs": true 48 | } -------------------------------------------------------------------------------- /sub/settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "cocos-analytics": { 3 | "appID": "13798", 4 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2", 5 | "channel": "", 6 | "enable": false, 7 | "version": "" 8 | }, 9 | "collision-matrix": [ 10 | [ 11 | true 12 | ] 13 | ], 14 | "design-resolution-height": 640, 15 | "design-resolution-width": 960, 16 | "excluded-modules": [ 17 | "Dynamic Atlas", 18 | "ParticleSystem", 19 | "TiledMap", 20 | "Spine Skeleton", 21 | "DragonBones", 22 | "RichText", 23 | "MotionStreak", 24 | "ProgressBar", 25 | "ScrollBar", 26 | "Toggle", 27 | "PageView", 28 | "PageViewIndicator", 29 | "Slider", 30 | "EditBox", 31 | "VideoPlayer", 32 | "WebView", 33 | "Audio", 34 | "AudioSource", 35 | "Animation", 36 | "Collider", 37 | "Action", 38 | "Physics", 39 | "NodePool", 40 | "StudioComponent", 41 | "Intersection", 42 | "Native NetWork", 43 | "3D", 44 | "Mesh" 45 | ], 46 | "fit-height": true, 47 | "fit-width": false, 48 | "group-list": [ 49 | "default" 50 | ], 51 | "simulator-orientation": false, 52 | "simulator-resolution": { 53 | "height": 640, 54 | "width": 960 55 | }, 56 | "use-customize-simulator": false, 57 | "use-project-simulator-setting": false 58 | } --------------------------------------------------------------------------------