├── .gitignore ├── README.md ├── assets ├── Hall.fire ├── Hall.fire.meta ├── JavaScript.meta ├── JavaScript │ ├── Alert.js │ ├── Alert.js.meta │ ├── Hall.js │ └── Hall.js.meta ├── Texture.meta ├── Texture │ ├── Alert.meta │ ├── Alert │ │ ├── alert_background.png │ │ ├── alert_background.png.meta │ │ ├── alert_cancel.png │ │ ├── alert_cancel.png.meta │ │ ├── alert_enter.png │ │ ├── alert_enter.png.meta │ │ ├── singleColor.png │ │ └── singleColor.png.meta │ ├── 游戏大厅.jpg │ └── 游戏大厅.jpg.meta ├── resources.meta └── resources │ ├── Alert.prefab │ └── Alert.prefab.meta ├── creator.d.ts ├── jsconfig.json ├── project.json ├── res └── raw-assets │ └── JavaScript │ └── Alert.js ├── settings ├── builder.json └── project.json └── socket.io └── socket.io.js /.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/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CCAlert 2 | 3 | > CocosCreator 一个弹窗插件。 4 | 5 | # 前言 6 | > 刚接触 CocosCreator、JavaScript,写了一个游戏的弹窗插件,记录笔记的同时也分享给和我一样在学习道路上的小伙伴。代码规范包括逻辑等都欢迎新老客户提出宝贵意见。 7 | 8 | ## 效果图 9 | ![效果图.gif](http://upload-images.jianshu.io/upload_images/1874013-fa04cc7c848c9a53.gif?imageMogr2/auto-orient/strip) 10 | 11 | ## 使用方法 12 | > **这里注意:** 13 | > **1.** **Alert** 的 `prefab` 文件一定要放到 **assets/resources** 目录下,因为 **cc.loader.loadRes** 方法加载的需放在 **resources**。 14 | > **2.** **Alert** 的 `js` 文件勾选 `导入为插件的复选框,这样才能全局访问。不勾选的话可以在想使用的地方引用也可。 15 | 16 | > **代码使用:**`Alert.show("文字内容", 确定按钮点击回调函数, true/false(是否显示取消按钮), 动画速度)`。 17 | 18 | ![QQ20170804-154530.png](http://upload-images.jianshu.io/upload_images/1874013-17c886ee6179def7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600) 19 | 20 | **[简书文章地址](http://www.jianshu.com/p/ee3f9940cb23)** 21 | 22 | ## 总结 23 | > 欢迎评论吐槽! 24 | -------------------------------------------------------------------------------- /assets/Hall.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 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 | "_tag": -1, 21 | "_active": true, 22 | "_components": [], 23 | "_prefab": null, 24 | "_id": "f623fdd9-deb4-4a4f-9d03-928453787596", 25 | "_opacity": 255, 26 | "_color": { 27 | "__type__": "cc.Color", 28 | "r": 255, 29 | "g": 255, 30 | "b": 255, 31 | "a": 255 32 | }, 33 | "_cascadeOpacityEnabled": true, 34 | "_anchorPoint": { 35 | "__type__": "cc.Vec2", 36 | "x": 0, 37 | "y": 0 38 | }, 39 | "_contentSize": { 40 | "__type__": "cc.Size", 41 | "width": 0, 42 | "height": 0 43 | }, 44 | "_localZOrder": 0, 45 | "_globalZOrder": 0, 46 | "_opacityModifyRGB": false, 47 | "groupIndex": 0, 48 | "autoReleaseAssets": false 49 | }, 50 | { 51 | "__type__": "cc.Node", 52 | "_name": "Canvas", 53 | "_objFlags": 0, 54 | "_parent": { 55 | "__id__": 1 56 | }, 57 | "_children": [ 58 | { 59 | "__id__": 3 60 | } 61 | ], 62 | "_tag": -1, 63 | "_active": true, 64 | "_components": [ 65 | { 66 | "__id__": 29 67 | }, 68 | { 69 | "__id__": 30 70 | } 71 | ], 72 | "_prefab": null, 73 | "_id": "ceJWcaLBBMD7DUj+AKwq44", 74 | "_opacity": 255, 75 | "_color": { 76 | "__type__": "cc.Color", 77 | "r": 255, 78 | "g": 255, 79 | "b": 255, 80 | "a": 255 81 | }, 82 | "_cascadeOpacityEnabled": true, 83 | "_anchorPoint": { 84 | "__type__": "cc.Vec2", 85 | "x": 0.5, 86 | "y": 0.5 87 | }, 88 | "_contentSize": { 89 | "__type__": "cc.Size", 90 | "width": 1334, 91 | "height": 750 92 | }, 93 | "_rotationX": 0, 94 | "_rotationY": 0, 95 | "_scaleX": 1, 96 | "_scaleY": 1, 97 | "_position": { 98 | "__type__": "cc.Vec2", 99 | "x": 667, 100 | "y": 375 101 | }, 102 | "_skewX": 0, 103 | "_skewY": 0, 104 | "_localZOrder": 0, 105 | "_globalZOrder": 0, 106 | "_opacityModifyRGB": false, 107 | "groupIndex": 0 108 | }, 109 | { 110 | "__type__": "cc.Node", 111 | "_name": "游戏大厅", 112 | "_objFlags": 0, 113 | "_parent": { 114 | "__id__": 2 115 | }, 116 | "_children": [ 117 | { 118 | "__id__": 4 119 | }, 120 | { 121 | "__id__": 10 122 | }, 123 | { 124 | "__id__": 16 125 | }, 126 | { 127 | "__id__": 22 128 | } 129 | ], 130 | "_tag": -1, 131 | "_active": true, 132 | "_components": [ 133 | { 134 | "__id__": 28 135 | } 136 | ], 137 | "_prefab": null, 138 | "_id": "56MnwNco9HBqIl947KqTdp", 139 | "_opacity": 255, 140 | "_color": { 141 | "__type__": "cc.Color", 142 | "r": 255, 143 | "g": 255, 144 | "b": 255, 145 | "a": 255 146 | }, 147 | "_cascadeOpacityEnabled": true, 148 | "_anchorPoint": { 149 | "__type__": "cc.Vec2", 150 | "x": 0.5, 151 | "y": 0.5 152 | }, 153 | "_contentSize": { 154 | "__type__": "cc.Size", 155 | "width": 1334, 156 | "height": 750 157 | }, 158 | "_rotationX": 0, 159 | "_rotationY": 0, 160 | "_scaleX": 1, 161 | "_scaleY": 1, 162 | "_position": { 163 | "__type__": "cc.Vec2", 164 | "x": 0, 165 | "y": 0 166 | }, 167 | "_skewX": 0, 168 | "_skewY": 0, 169 | "_localZOrder": 0, 170 | "_globalZOrder": 0, 171 | "_opacityModifyRGB": false, 172 | "groupIndex": 0 173 | }, 174 | { 175 | "__type__": "cc.Node", 176 | "_name": "button", 177 | "_objFlags": 0, 178 | "_parent": { 179 | "__id__": 3 180 | }, 181 | "_children": [ 182 | { 183 | "__id__": 5 184 | } 185 | ], 186 | "_tag": -1, 187 | "_active": true, 188 | "_components": [ 189 | { 190 | "__id__": 7 191 | }, 192 | { 193 | "__id__": 8 194 | } 195 | ], 196 | "_prefab": null, 197 | "_id": "0bC4zCxCFBAIfAZ+bx+lge", 198 | "_opacity": 255, 199 | "_color": { 200 | "__type__": "cc.Color", 201 | "r": 255, 202 | "g": 255, 203 | "b": 255, 204 | "a": 255 205 | }, 206 | "_cascadeOpacityEnabled": true, 207 | "_anchorPoint": { 208 | "__type__": "cc.Vec2", 209 | "x": 0.5, 210 | "y": 0.5 211 | }, 212 | "_contentSize": { 213 | "__type__": "cc.Size", 214 | "width": 213, 215 | "height": 69 216 | }, 217 | "_rotationX": 0, 218 | "_rotationY": 0, 219 | "_scaleX": 1, 220 | "_scaleY": 1, 221 | "_position": { 222 | "__type__": "cc.Vec2", 223 | "x": -49, 224 | "y": 193 225 | }, 226 | "_skewX": 0, 227 | "_skewY": 0, 228 | "_localZOrder": 0, 229 | "_globalZOrder": 0, 230 | "_opacityModifyRGB": false, 231 | "groupIndex": 0 232 | }, 233 | { 234 | "__type__": "cc.Node", 235 | "_name": "Label", 236 | "_objFlags": 0, 237 | "_parent": { 238 | "__id__": 4 239 | }, 240 | "_children": [], 241 | "_tag": -1, 242 | "_active": true, 243 | "_components": [ 244 | { 245 | "__id__": 6 246 | } 247 | ], 248 | "_prefab": null, 249 | "_id": "a5mNPGAr1LbqA/Fj7Gmd6H", 250 | "_opacity": 255, 251 | "_color": { 252 | "__type__": "cc.Color", 253 | "r": 0, 254 | "g": 0, 255 | "b": 0, 256 | "a": 255 257 | }, 258 | "_cascadeOpacityEnabled": true, 259 | "_anchorPoint": { 260 | "__type__": "cc.Vec2", 261 | "x": 0.5, 262 | "y": 0.5 263 | }, 264 | "_contentSize": { 265 | "__type__": "cc.Size", 266 | "width": 204, 267 | "height": 58 268 | }, 269 | "_rotationX": 0, 270 | "_rotationY": 0, 271 | "_scaleX": 1, 272 | "_scaleY": 1, 273 | "_position": { 274 | "__type__": "cc.Vec2", 275 | "x": 0, 276 | "y": 0 277 | }, 278 | "_skewX": 0, 279 | "_skewY": 0, 280 | "_localZOrder": 0, 281 | "_globalZOrder": 0, 282 | "_opacityModifyRGB": false, 283 | "groupIndex": 0 284 | }, 285 | { 286 | "__type__": "cc.Label", 287 | "_name": "", 288 | "_objFlags": 0, 289 | "node": { 290 | "__id__": 5 291 | }, 292 | "_enabled": true, 293 | "_useOriginalSize": false, 294 | "_actualFontSize": 20, 295 | "_fontSize": 20, 296 | "_lineHeight": 40, 297 | "_enableWrapText": false, 298 | "_N$file": null, 299 | "_isSystemFontUsed": true, 300 | "_spacingX": 0, 301 | "_N$string": "showAlertText", 302 | "_N$horizontalAlign": 1, 303 | "_N$verticalAlign": 1, 304 | "_N$fontFamily": "Arial", 305 | "_N$overflow": 1 306 | }, 307 | { 308 | "__type__": "cc.Sprite", 309 | "_name": "", 310 | "_objFlags": 0, 311 | "node": { 312 | "__id__": 4 313 | }, 314 | "_enabled": true, 315 | "_spriteFrame": { 316 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 317 | }, 318 | "_type": 1, 319 | "_sizeMode": 0, 320 | "_fillType": 0, 321 | "_fillCenter": { 322 | "__type__": "cc.Vec2", 323 | "x": 0, 324 | "y": 0 325 | }, 326 | "_fillStart": 0, 327 | "_fillRange": 0, 328 | "_isTrimmedMode": true, 329 | "_srcBlendFactor": 770, 330 | "_dstBlendFactor": 771, 331 | "_atlas": null 332 | }, 333 | { 334 | "__type__": "cc.Button", 335 | "_name": "", 336 | "_objFlags": 0, 337 | "node": { 338 | "__id__": 4 339 | }, 340 | "_enabled": true, 341 | "transition": 2, 342 | "pressedColor": { 343 | "__type__": "cc.Color", 344 | "r": 255, 345 | "g": 255, 346 | "b": 255, 347 | "a": 255 348 | }, 349 | "hoverColor": { 350 | "__type__": "cc.Color", 351 | "r": 255, 352 | "g": 255, 353 | "b": 255, 354 | "a": 255 355 | }, 356 | "duration": 0.1, 357 | "zoomScale": 1.2, 358 | "pressedSprite": { 359 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 360 | }, 361 | "hoverSprite": { 362 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 363 | }, 364 | "clickEvents": [ 365 | { 366 | "__id__": 9 367 | } 368 | ], 369 | "_N$interactable": true, 370 | "_N$enableAutoGrayEffect": false, 371 | "_N$normalColor": { 372 | "__type__": "cc.Color", 373 | "r": 255, 374 | "g": 255, 375 | "b": 255, 376 | "a": 255 377 | }, 378 | "_N$disabledColor": { 379 | "__type__": "cc.Color", 380 | "r": 255, 381 | "g": 255, 382 | "b": 255, 383 | "a": 255 384 | }, 385 | "_N$normalSprite": { 386 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 387 | }, 388 | "_N$disabledSprite": { 389 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 390 | }, 391 | "_N$target": { 392 | "__id__": 4 393 | } 394 | }, 395 | { 396 | "__type__": "cc.ClickEvent", 397 | "target": { 398 | "__id__": 2 399 | }, 400 | "component": "Hall", 401 | "handler": "showAlertText", 402 | "customEventData": "" 403 | }, 404 | { 405 | "__type__": "cc.Node", 406 | "_name": "button", 407 | "_objFlags": 0, 408 | "_parent": { 409 | "__id__": 3 410 | }, 411 | "_children": [ 412 | { 413 | "__id__": 11 414 | } 415 | ], 416 | "_tag": -1, 417 | "_active": true, 418 | "_components": [ 419 | { 420 | "__id__": 13 421 | }, 422 | { 423 | "__id__": 14 424 | } 425 | ], 426 | "_prefab": null, 427 | "_id": "5f4we+3u1L47km8uIUkpI1", 428 | "_opacity": 255, 429 | "_color": { 430 | "__type__": "cc.Color", 431 | "r": 255, 432 | "g": 255, 433 | "b": 255, 434 | "a": 255 435 | }, 436 | "_cascadeOpacityEnabled": true, 437 | "_anchorPoint": { 438 | "__type__": "cc.Vec2", 439 | "x": 0.5, 440 | "y": 0.5 441 | }, 442 | "_contentSize": { 443 | "__type__": "cc.Size", 444 | "width": 213, 445 | "height": 69 446 | }, 447 | "_rotationX": 0, 448 | "_rotationY": 0, 449 | "_scaleX": 1, 450 | "_scaleY": 1, 451 | "_position": { 452 | "__type__": "cc.Vec2", 453 | "x": -49, 454 | "y": 100 455 | }, 456 | "_skewX": 0, 457 | "_skewY": 0, 458 | "_localZOrder": 0, 459 | "_globalZOrder": 0, 460 | "_opacityModifyRGB": false, 461 | "groupIndex": 0 462 | }, 463 | { 464 | "__type__": "cc.Node", 465 | "_name": "Label", 466 | "_objFlags": 0, 467 | "_parent": { 468 | "__id__": 10 469 | }, 470 | "_children": [], 471 | "_tag": -1, 472 | "_active": true, 473 | "_components": [ 474 | { 475 | "__id__": 12 476 | } 477 | ], 478 | "_prefab": null, 479 | "_id": "b1FPsf6TdNs6IyU6bEbTc6", 480 | "_opacity": 255, 481 | "_color": { 482 | "__type__": "cc.Color", 483 | "r": 0, 484 | "g": 0, 485 | "b": 0, 486 | "a": 255 487 | }, 488 | "_cascadeOpacityEnabled": true, 489 | "_anchorPoint": { 490 | "__type__": "cc.Vec2", 491 | "x": 0.5, 492 | "y": 0.5 493 | }, 494 | "_contentSize": { 495 | "__type__": "cc.Size", 496 | "width": 204, 497 | "height": 58 498 | }, 499 | "_rotationX": 0, 500 | "_rotationY": 0, 501 | "_scaleX": 1, 502 | "_scaleY": 1, 503 | "_position": { 504 | "__type__": "cc.Vec2", 505 | "x": 0, 506 | "y": 0 507 | }, 508 | "_skewX": 0, 509 | "_skewY": 0, 510 | "_localZOrder": 0, 511 | "_globalZOrder": 0, 512 | "_opacityModifyRGB": false, 513 | "groupIndex": 0 514 | }, 515 | { 516 | "__type__": "cc.Label", 517 | "_name": "", 518 | "_objFlags": 0, 519 | "node": { 520 | "__id__": 11 521 | }, 522 | "_enabled": true, 523 | "_useOriginalSize": false, 524 | "_actualFontSize": 20, 525 | "_fontSize": 20, 526 | "_lineHeight": 40, 527 | "_enableWrapText": false, 528 | "_N$file": null, 529 | "_isSystemFontUsed": true, 530 | "_spacingX": 0, 531 | "_N$string": "showAlertCallBack", 532 | "_N$horizontalAlign": 1, 533 | "_N$verticalAlign": 1, 534 | "_N$fontFamily": "Arial", 535 | "_N$overflow": 1 536 | }, 537 | { 538 | "__type__": "cc.Sprite", 539 | "_name": "", 540 | "_objFlags": 0, 541 | "node": { 542 | "__id__": 10 543 | }, 544 | "_enabled": true, 545 | "_spriteFrame": { 546 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 547 | }, 548 | "_type": 1, 549 | "_sizeMode": 0, 550 | "_fillType": 0, 551 | "_fillCenter": { 552 | "__type__": "cc.Vec2", 553 | "x": 0, 554 | "y": 0 555 | }, 556 | "_fillStart": 0, 557 | "_fillRange": 0, 558 | "_isTrimmedMode": true, 559 | "_srcBlendFactor": 770, 560 | "_dstBlendFactor": 771, 561 | "_atlas": null 562 | }, 563 | { 564 | "__type__": "cc.Button", 565 | "_name": "", 566 | "_objFlags": 0, 567 | "node": { 568 | "__id__": 10 569 | }, 570 | "_enabled": true, 571 | "transition": 2, 572 | "pressedColor": { 573 | "__type__": "cc.Color", 574 | "r": 255, 575 | "g": 255, 576 | "b": 255, 577 | "a": 255 578 | }, 579 | "hoverColor": { 580 | "__type__": "cc.Color", 581 | "r": 255, 582 | "g": 255, 583 | "b": 255, 584 | "a": 255 585 | }, 586 | "duration": 0.1, 587 | "zoomScale": 1.2, 588 | "pressedSprite": { 589 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 590 | }, 591 | "hoverSprite": { 592 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 593 | }, 594 | "clickEvents": [ 595 | { 596 | "__id__": 15 597 | } 598 | ], 599 | "_N$interactable": true, 600 | "_N$enableAutoGrayEffect": false, 601 | "_N$normalColor": { 602 | "__type__": "cc.Color", 603 | "r": 255, 604 | "g": 255, 605 | "b": 255, 606 | "a": 255 607 | }, 608 | "_N$disabledColor": { 609 | "__type__": "cc.Color", 610 | "r": 255, 611 | "g": 255, 612 | "b": 255, 613 | "a": 255 614 | }, 615 | "_N$normalSprite": { 616 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 617 | }, 618 | "_N$disabledSprite": { 619 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 620 | }, 621 | "_N$target": { 622 | "__id__": 10 623 | } 624 | }, 625 | { 626 | "__type__": "cc.ClickEvent", 627 | "target": { 628 | "__id__": 2 629 | }, 630 | "component": "Hall", 631 | "handler": "showAlertCallBack", 632 | "customEventData": "" 633 | }, 634 | { 635 | "__type__": "cc.Node", 636 | "_name": "button", 637 | "_objFlags": 0, 638 | "_parent": { 639 | "__id__": 3 640 | }, 641 | "_children": [ 642 | { 643 | "__id__": 17 644 | } 645 | ], 646 | "_tag": -1, 647 | "_active": true, 648 | "_components": [ 649 | { 650 | "__id__": 19 651 | }, 652 | { 653 | "__id__": 20 654 | } 655 | ], 656 | "_prefab": null, 657 | "_id": "b8Ci+TJ2BMbYyYIQoXgYp7", 658 | "_opacity": 255, 659 | "_color": { 660 | "__type__": "cc.Color", 661 | "r": 255, 662 | "g": 255, 663 | "b": 255, 664 | "a": 255 665 | }, 666 | "_cascadeOpacityEnabled": true, 667 | "_anchorPoint": { 668 | "__type__": "cc.Vec2", 669 | "x": 0.5, 670 | "y": 0.5 671 | }, 672 | "_contentSize": { 673 | "__type__": "cc.Size", 674 | "width": 213, 675 | "height": 69 676 | }, 677 | "_rotationX": 0, 678 | "_rotationY": 0, 679 | "_scaleX": 1, 680 | "_scaleY": 1, 681 | "_position": { 682 | "__type__": "cc.Vec2", 683 | "x": -49, 684 | "y": 11 685 | }, 686 | "_skewX": 0, 687 | "_skewY": 0, 688 | "_localZOrder": 0, 689 | "_globalZOrder": 0, 690 | "_opacityModifyRGB": false, 691 | "groupIndex": 0 692 | }, 693 | { 694 | "__type__": "cc.Node", 695 | "_name": "Label", 696 | "_objFlags": 0, 697 | "_parent": { 698 | "__id__": 16 699 | }, 700 | "_children": [], 701 | "_tag": -1, 702 | "_active": true, 703 | "_components": [ 704 | { 705 | "__id__": 18 706 | } 707 | ], 708 | "_prefab": null, 709 | "_id": "b6So8wPz1JmZSAbH8OTOE5", 710 | "_opacity": 255, 711 | "_color": { 712 | "__type__": "cc.Color", 713 | "r": 0, 714 | "g": 0, 715 | "b": 0, 716 | "a": 255 717 | }, 718 | "_cascadeOpacityEnabled": true, 719 | "_anchorPoint": { 720 | "__type__": "cc.Vec2", 721 | "x": 0.5, 722 | "y": 0.5 723 | }, 724 | "_contentSize": { 725 | "__type__": "cc.Size", 726 | "width": 204, 727 | "height": 58 728 | }, 729 | "_rotationX": 0, 730 | "_rotationY": 0, 731 | "_scaleX": 1, 732 | "_scaleY": 1, 733 | "_position": { 734 | "__type__": "cc.Vec2", 735 | "x": 0, 736 | "y": 0 737 | }, 738 | "_skewX": 0, 739 | "_skewY": 0, 740 | "_localZOrder": 0, 741 | "_globalZOrder": 0, 742 | "_opacityModifyRGB": false, 743 | "groupIndex": 0 744 | }, 745 | { 746 | "__type__": "cc.Label", 747 | "_name": "", 748 | "_objFlags": 0, 749 | "node": { 750 | "__id__": 17 751 | }, 752 | "_enabled": true, 753 | "_useOriginalSize": false, 754 | "_actualFontSize": 20, 755 | "_fontSize": 20, 756 | "_lineHeight": 40, 757 | "_enableWrapText": false, 758 | "_N$file": null, 759 | "_isSystemFontUsed": true, 760 | "_spacingX": 0, 761 | "_N$string": "showAlertOnlayEnter", 762 | "_N$horizontalAlign": 1, 763 | "_N$verticalAlign": 1, 764 | "_N$fontFamily": "Arial", 765 | "_N$overflow": 1 766 | }, 767 | { 768 | "__type__": "cc.Sprite", 769 | "_name": "", 770 | "_objFlags": 0, 771 | "node": { 772 | "__id__": 16 773 | }, 774 | "_enabled": true, 775 | "_spriteFrame": { 776 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 777 | }, 778 | "_type": 1, 779 | "_sizeMode": 0, 780 | "_fillType": 0, 781 | "_fillCenter": { 782 | "__type__": "cc.Vec2", 783 | "x": 0, 784 | "y": 0 785 | }, 786 | "_fillStart": 0, 787 | "_fillRange": 0, 788 | "_isTrimmedMode": true, 789 | "_srcBlendFactor": 770, 790 | "_dstBlendFactor": 771, 791 | "_atlas": null 792 | }, 793 | { 794 | "__type__": "cc.Button", 795 | "_name": "", 796 | "_objFlags": 0, 797 | "node": { 798 | "__id__": 16 799 | }, 800 | "_enabled": true, 801 | "transition": 2, 802 | "pressedColor": { 803 | "__type__": "cc.Color", 804 | "r": 255, 805 | "g": 255, 806 | "b": 255, 807 | "a": 255 808 | }, 809 | "hoverColor": { 810 | "__type__": "cc.Color", 811 | "r": 255, 812 | "g": 255, 813 | "b": 255, 814 | "a": 255 815 | }, 816 | "duration": 0.1, 817 | "zoomScale": 1.2, 818 | "pressedSprite": { 819 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 820 | }, 821 | "hoverSprite": { 822 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 823 | }, 824 | "clickEvents": [ 825 | { 826 | "__id__": 21 827 | } 828 | ], 829 | "_N$interactable": true, 830 | "_N$enableAutoGrayEffect": false, 831 | "_N$normalColor": { 832 | "__type__": "cc.Color", 833 | "r": 255, 834 | "g": 255, 835 | "b": 255, 836 | "a": 255 837 | }, 838 | "_N$disabledColor": { 839 | "__type__": "cc.Color", 840 | "r": 255, 841 | "g": 255, 842 | "b": 255, 843 | "a": 255 844 | }, 845 | "_N$normalSprite": { 846 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 847 | }, 848 | "_N$disabledSprite": { 849 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 850 | }, 851 | "_N$target": { 852 | "__id__": 16 853 | } 854 | }, 855 | { 856 | "__type__": "cc.ClickEvent", 857 | "target": { 858 | "__id__": 2 859 | }, 860 | "component": "Hall", 861 | "handler": "showAlertOnlayEnter", 862 | "customEventData": "" 863 | }, 864 | { 865 | "__type__": "cc.Node", 866 | "_name": "button", 867 | "_objFlags": 0, 868 | "_parent": { 869 | "__id__": 3 870 | }, 871 | "_children": [ 872 | { 873 | "__id__": 23 874 | } 875 | ], 876 | "_tag": -1, 877 | "_active": true, 878 | "_components": [ 879 | { 880 | "__id__": 25 881 | }, 882 | { 883 | "__id__": 26 884 | } 885 | ], 886 | "_prefab": null, 887 | "_id": "cf3PwOg8NARYrscTis4Mjm", 888 | "_opacity": 255, 889 | "_color": { 890 | "__type__": "cc.Color", 891 | "r": 255, 892 | "g": 255, 893 | "b": 255, 894 | "a": 255 895 | }, 896 | "_cascadeOpacityEnabled": true, 897 | "_anchorPoint": { 898 | "__type__": "cc.Vec2", 899 | "x": 0.5, 900 | "y": 0.5 901 | }, 902 | "_contentSize": { 903 | "__type__": "cc.Size", 904 | "width": 213, 905 | "height": 69 906 | }, 907 | "_rotationX": 0, 908 | "_rotationY": 0, 909 | "_scaleX": 1, 910 | "_scaleY": 1, 911 | "_position": { 912 | "__type__": "cc.Vec2", 913 | "x": -49, 914 | "y": -87 915 | }, 916 | "_skewX": 0, 917 | "_skewY": 0, 918 | "_localZOrder": 0, 919 | "_globalZOrder": 0, 920 | "_opacityModifyRGB": false, 921 | "groupIndex": 0 922 | }, 923 | { 924 | "__type__": "cc.Node", 925 | "_name": "Label", 926 | "_objFlags": 0, 927 | "_parent": { 928 | "__id__": 22 929 | }, 930 | "_children": [], 931 | "_tag": -1, 932 | "_active": true, 933 | "_components": [ 934 | { 935 | "__id__": 24 936 | } 937 | ], 938 | "_prefab": null, 939 | "_id": "c11I+xSrlKoqDFmk41YIrV", 940 | "_opacity": 255, 941 | "_color": { 942 | "__type__": "cc.Color", 943 | "r": 0, 944 | "g": 0, 945 | "b": 0, 946 | "a": 255 947 | }, 948 | "_cascadeOpacityEnabled": true, 949 | "_anchorPoint": { 950 | "__type__": "cc.Vec2", 951 | "x": 0.5, 952 | "y": 0.5 953 | }, 954 | "_contentSize": { 955 | "__type__": "cc.Size", 956 | "width": 204, 957 | "height": 58 958 | }, 959 | "_rotationX": 0, 960 | "_rotationY": 0, 961 | "_scaleX": 1, 962 | "_scaleY": 1, 963 | "_position": { 964 | "__type__": "cc.Vec2", 965 | "x": 0, 966 | "y": 0 967 | }, 968 | "_skewX": 0, 969 | "_skewY": 0, 970 | "_localZOrder": 0, 971 | "_globalZOrder": 0, 972 | "_opacityModifyRGB": false, 973 | "groupIndex": 0 974 | }, 975 | { 976 | "__type__": "cc.Label", 977 | "_name": "", 978 | "_objFlags": 0, 979 | "node": { 980 | "__id__": 23 981 | }, 982 | "_enabled": true, 983 | "_useOriginalSize": false, 984 | "_actualFontSize": 20, 985 | "_fontSize": 20, 986 | "_lineHeight": 40, 987 | "_enableWrapText": false, 988 | "_N$file": null, 989 | "_isSystemFontUsed": true, 990 | "_spacingX": 0, 991 | "_N$string": "showAlertAnimSpeed", 992 | "_N$horizontalAlign": 1, 993 | "_N$verticalAlign": 1, 994 | "_N$fontFamily": "Arial", 995 | "_N$overflow": 1 996 | }, 997 | { 998 | "__type__": "cc.Sprite", 999 | "_name": "", 1000 | "_objFlags": 0, 1001 | "node": { 1002 | "__id__": 22 1003 | }, 1004 | "_enabled": true, 1005 | "_spriteFrame": { 1006 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1007 | }, 1008 | "_type": 1, 1009 | "_sizeMode": 0, 1010 | "_fillType": 0, 1011 | "_fillCenter": { 1012 | "__type__": "cc.Vec2", 1013 | "x": 0, 1014 | "y": 0 1015 | }, 1016 | "_fillStart": 0, 1017 | "_fillRange": 0, 1018 | "_isTrimmedMode": true, 1019 | "_srcBlendFactor": 770, 1020 | "_dstBlendFactor": 771, 1021 | "_atlas": null 1022 | }, 1023 | { 1024 | "__type__": "cc.Button", 1025 | "_name": "", 1026 | "_objFlags": 0, 1027 | "node": { 1028 | "__id__": 22 1029 | }, 1030 | "_enabled": true, 1031 | "transition": 2, 1032 | "pressedColor": { 1033 | "__type__": "cc.Color", 1034 | "r": 255, 1035 | "g": 255, 1036 | "b": 255, 1037 | "a": 255 1038 | }, 1039 | "hoverColor": { 1040 | "__type__": "cc.Color", 1041 | "r": 255, 1042 | "g": 255, 1043 | "b": 255, 1044 | "a": 255 1045 | }, 1046 | "duration": 0.1, 1047 | "zoomScale": 1.2, 1048 | "pressedSprite": { 1049 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1050 | }, 1051 | "hoverSprite": { 1052 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1053 | }, 1054 | "clickEvents": [ 1055 | { 1056 | "__id__": 27 1057 | } 1058 | ], 1059 | "_N$interactable": true, 1060 | "_N$enableAutoGrayEffect": false, 1061 | "_N$normalColor": { 1062 | "__type__": "cc.Color", 1063 | "r": 255, 1064 | "g": 255, 1065 | "b": 255, 1066 | "a": 255 1067 | }, 1068 | "_N$disabledColor": { 1069 | "__type__": "cc.Color", 1070 | "r": 255, 1071 | "g": 255, 1072 | "b": 255, 1073 | "a": 255 1074 | }, 1075 | "_N$normalSprite": { 1076 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1077 | }, 1078 | "_N$disabledSprite": { 1079 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1080 | }, 1081 | "_N$target": { 1082 | "__id__": 22 1083 | } 1084 | }, 1085 | { 1086 | "__type__": "cc.ClickEvent", 1087 | "target": { 1088 | "__id__": 2 1089 | }, 1090 | "component": "Hall", 1091 | "handler": "showAlertAnimSpeed", 1092 | "customEventData": "" 1093 | }, 1094 | { 1095 | "__type__": "cc.Sprite", 1096 | "_name": "", 1097 | "_objFlags": 0, 1098 | "node": { 1099 | "__id__": 3 1100 | }, 1101 | "_enabled": true, 1102 | "_spriteFrame": { 1103 | "__uuid__": "78255000-b276-44e2-a10c-b4b607df73ff" 1104 | }, 1105 | "_type": 0, 1106 | "_sizeMode": 1, 1107 | "_fillType": 0, 1108 | "_fillCenter": { 1109 | "__type__": "cc.Vec2", 1110 | "x": 0, 1111 | "y": 0 1112 | }, 1113 | "_fillStart": 0, 1114 | "_fillRange": 0, 1115 | "_isTrimmedMode": true, 1116 | "_srcBlendFactor": 770, 1117 | "_dstBlendFactor": 771, 1118 | "_atlas": null 1119 | }, 1120 | { 1121 | "__type__": "cc.Canvas", 1122 | "_name": "", 1123 | "_objFlags": 0, 1124 | "node": { 1125 | "__id__": 2 1126 | }, 1127 | "_enabled": true, 1128 | "_designResolution": { 1129 | "__type__": "cc.Size", 1130 | "width": 1334, 1131 | "height": 750 1132 | }, 1133 | "_fitWidth": true, 1134 | "_fitHeight": false 1135 | }, 1136 | { 1137 | "__type__": "4e723XX1VVBKrkIxGH9dFRb", 1138 | "_name": "", 1139 | "_objFlags": 0, 1140 | "node": { 1141 | "__id__": 2 1142 | }, 1143 | "_enabled": true 1144 | } 1145 | ] -------------------------------------------------------------------------------- /assets/Hall.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "f623fdd9-deb4-4a4f-9d03-928453787596", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/JavaScript.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6f492029-5713-4955-bcbf-ad6a54d299ec", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/JavaScript/Alert.js: -------------------------------------------------------------------------------- 1 | var Alert = { 2 | _alert: null, // prefab 3 | _detailLabel: null, // 内容 4 | _cancelButton: null, // 确定按钮 5 | _enterButton: null, // 取消按钮 6 | _enterCallBack: null, // 回调事件 7 | _animSpeed: 0.3, // 动画速度 8 | }; 9 | 10 | /** 11 | * detailString : 内容 string 类型. 12 | * enterCallBack: 确定点击事件回调 function 类型. 13 | * neeCancel: 是否展示取消按钮 bool 类型 default YES. 14 | * duration: 动画速度 default = 0.3. 15 | */ 16 | Alert.show = function (detailString, enterCallBack, needCancel, animSpeed) { 17 | 18 | // 引用 19 | var self = this; 20 | 21 | // 判断 22 | if (Alert._alert != undefined) return; 23 | 24 | // 25 | Alert._animSpeed = animSpeed ? animSpeed : Alert._animSpeed; 26 | 27 | // 加载 prefab 创建 28 | cc.loader.loadRes("Alert", cc.Prefab, function (error, prefab) { 29 | 30 | if (error) { 31 | cc.error(error); 32 | return; 33 | } 34 | 35 | // 实例 36 | var alert = cc.instantiate(prefab); 37 | 38 | // Alert 持有 39 | Alert._alert = alert; 40 | 41 | // 动画 42 | var cbFadeOut = cc.callFunc(self.onFadeOutFinish, self); 43 | var cbFadeIn = cc.callFunc(self.onFadeInFinish, self); 44 | self.actionFadeIn = cc.sequence(cc.spawn(cc.fadeTo(Alert._animSpeed, 255), cc.scaleTo(Alert._animSpeed, 1.0)), cbFadeIn); 45 | self.actionFadeOut = cc.sequence(cc.spawn(cc.fadeTo(Alert._animSpeed, 0), cc.scaleTo(Alert._animSpeed, 2.0)), cbFadeOut); 46 | 47 | // 获取子节点 48 | Alert._detailLabel = cc.find("alertBackground/detailLabel", alert).getComponent(cc.Label); 49 | Alert._cancelButton = cc.find("alertBackground/cancelButton", alert); 50 | Alert._enterButton = cc.find("alertBackground/enterButton", alert); 51 | 52 | // 添加点击事件 53 | Alert._enterButton.on('click', self.onButtonClicked, self); 54 | Alert._cancelButton.on('click', self.onButtonClicked, self); 55 | 56 | // 父视图 57 | Alert._alert.parent = cc.find("Canvas"); 58 | 59 | // 展现 alert 60 | self.startFadeIn(); 61 | 62 | // 参数 63 | self.configAlert(detailString, enterCallBack, needCancel, animSpeed); 64 | 65 | }); 66 | 67 | // 参数 68 | self.configAlert = function (detailString, enterCallBack, needCancel, animSpeed) { 69 | 70 | // 回调 71 | Alert._enterCallBack = enterCallBack; 72 | 73 | // 内容 74 | Alert._detailLabel.string = detailString; 75 | // 是否需要取消按钮 76 | if (needCancel || needCancel == undefined) { // 显示 77 | Alert._cancelButton.active = true; 78 | } else { // 隐藏 79 | Alert._cancelButton.active = false; 80 | Alert._enterButton.x = 0; 81 | } 82 | }; 83 | 84 | // 执行弹进动画 85 | self.startFadeIn = function () { 86 | cc.eventManager.pauseTarget(Alert._alert, true); 87 | Alert._alert.position = cc.p(0, 0); 88 | Alert._alert.setScale(2); 89 | Alert._alert.opacity = 0; 90 | Alert._alert.runAction(self.actionFadeIn); 91 | }; 92 | 93 | // 执行弹出动画 94 | self.startFadeOut = function () { 95 | cc.eventManager.pauseTarget(Alert._alert, true); 96 | Alert._alert.runAction(self.actionFadeOut); 97 | }; 98 | 99 | // 弹进动画完成回调 100 | self.onFadeInFinish = function () { 101 | cc.eventManager.resumeTarget(Alert._alert, true); 102 | }; 103 | 104 | // 弹出动画完成回调 105 | self.onFadeOutFinish = function () { 106 | self.onDestory(); 107 | }; 108 | 109 | // 按钮点击事件 110 | self.onButtonClicked = function(event){ 111 | if(event.target.name == "enterButton"){ 112 | if(self._enterCallBack){ 113 | self._enterCallBack(); 114 | } 115 | } 116 | self.startFadeOut(); 117 | }; 118 | 119 | // 销毁 alert (内存管理还没搞懂,暂且这样写吧~v~) 120 | self.onDestory = function () { 121 | Alert._alert.destroy(); 122 | Alert._enterCallBack = null; 123 | Alert._alert = null; 124 | Alert._detailLabel = null; 125 | Alert._cancelButton = null; 126 | Alert._enterButton = null; 127 | Alert._animSpeed = 0.3; 128 | }; 129 | }; 130 | 131 | 132 | -------------------------------------------------------------------------------- /assets/JavaScript/Alert.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "68dbb1bf-58a2-498c-a798-338a91cde52d", 4 | "isPlugin": true, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/JavaScript/Hall.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | }, 16 | 17 | // use this for initialization 18 | onLoad: function () { 19 | 20 | }, 21 | 22 | showAlertText: function () { 23 | Alert.show("难道还有这种操作?"); 24 | }, 25 | 26 | showAlertCallBack: function () { 27 | Alert.show("难道还有这种操作?", function(){ 28 | cc.log("确定按钮被点击!"); 29 | }); 30 | }, 31 | 32 | showAlertOnlayEnter: function () { 33 | Alert.show("难道还有这种操作?", null, false); 34 | }, 35 | 36 | showAlertAnimSpeed: function () { 37 | Alert.show("难道还有这种操作?", null, null, 0.1); 38 | }, 39 | 40 | // called every frame, uncomment this function to activate update callback 41 | // update: function (dt) { 42 | 43 | // }, 44 | }); 45 | -------------------------------------------------------------------------------- /assets/JavaScript/Hall.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4e7235d7-d555-412a-b908-c461fd74545b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Texture.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "78e3c6a8-309e-416c-8df2-f28a1351c328", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Texture/Alert.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d354e6f0-5f5c-44d5-a1e5-8159c452e3c2", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/assets/Texture/Alert/alert_background.png -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_background.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "2ef9ffa4-d90a-44f3-b9d1-627ea999cc02", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "alert_background": { 9 | "ver": "1.0.3", 10 | "uuid": "f226510d-f7be-44b7-b506-46f7302f67bd", 11 | "rawTextureUuid": "2ef9ffa4-d90a-44f3-b9d1-627ea999cc02", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": -1, 17 | "trimX": 0, 18 | "trimY": 2, 19 | "width": 190, 20 | "height": 148, 21 | "rawWidth": 190, 22 | "rawHeight": 150, 23 | "borderTop": 42, 24 | "borderBottom": 42, 25 | "borderLeft": 47, 26 | "borderRight": 50, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/assets/Texture/Alert/alert_cancel.png -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_cancel.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "d67664d8-2cff-4acb-96c1-a66e5e8774e0", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "alert_cancel": { 9 | "ver": "1.0.3", 10 | "uuid": "e4de196e-de54-4bd2-9e85-539b4bb79c5e", 11 | "rawTextureUuid": "d67664d8-2cff-4acb-96c1-a66e5e8774e0", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 180, 20 | "height": 70, 21 | "rawWidth": 180, 22 | "rawHeight": 70, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/assets/Texture/Alert/alert_enter.png -------------------------------------------------------------------------------- /assets/Texture/Alert/alert_enter.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "52826ca9-6dcc-4f99-9dbb-32f8d7e96195", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "alert_enter": { 9 | "ver": "1.0.3", 10 | "uuid": "8cba795f-f946-41c7-bd49-cc859d0b2897", 11 | "rawTextureUuid": "52826ca9-6dcc-4f99-9dbb-32f8d7e96195", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 180, 20 | "height": 70, 21 | "rawWidth": 180, 22 | "rawHeight": 70, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/Alert/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/assets/Texture/Alert/singleColor.png -------------------------------------------------------------------------------- /assets/Texture/Alert/singleColor.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "singleColor": { 9 | "ver": "1.0.3", 10 | "uuid": "410fb916-8721-4663-bab8-34397391ace7", 11 | "rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 2, 20 | "height": 2, 21 | "rawWidth": 2, 22 | "rawHeight": 2, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/游戏大厅.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/assets/Texture/游戏大厅.jpg -------------------------------------------------------------------------------- /assets/Texture/游戏大厅.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "521b542f-d6a7-4573-a6e7-bbded984c572", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "游戏大厅": { 9 | "ver": "1.0.3", 10 | "uuid": "78255000-b276-44e2-a10c-b4b607df73ff", 11 | "rawTextureUuid": "521b542f-d6a7-4573-a6e7-bbded984c572", 12 | "trimType": "auto", 13 | "trimThreshold": 1.3000000000000003, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 1334, 20 | "height": 750, 21 | "rawWidth": 1334, 22 | "rawHeight": 750, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "9390161a-9c48-4e3d-a9bd-f8aa7341c56f", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/Alert.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "Alert", 14 | "_objFlags": 0, 15 | "_parent": null, 16 | "_children": [ 17 | { 18 | "__id__": 2 19 | }, 20 | { 21 | "__id__": 6 22 | } 23 | ], 24 | "_tag": -1, 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 24 29 | }, 30 | { 31 | "__id__": 25 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 26 36 | }, 37 | "_id": "", 38 | "_opacity": 255, 39 | "_color": { 40 | "__type__": "cc.Color", 41 | "r": 0, 42 | "g": 0, 43 | "b": 0, 44 | "a": 255 45 | }, 46 | "_cascadeOpacityEnabled": true, 47 | "_anchorPoint": { 48 | "__type__": "cc.Vec2", 49 | "x": 0.5, 50 | "y": 0.5 51 | }, 52 | "_contentSize": { 53 | "__type__": "cc.Size", 54 | "width": 1334, 55 | "height": 750 56 | }, 57 | "_rotationX": 0, 58 | "_rotationY": 0, 59 | "_scaleX": 1, 60 | "_scaleY": 1, 61 | "_position": { 62 | "__type__": "cc.Vec2", 63 | "x": 667, 64 | "y": 375 65 | }, 66 | "_skewX": 0, 67 | "_skewY": 0, 68 | "_localZOrder": 0, 69 | "_globalZOrder": 0, 70 | "_opacityModifyRGB": false, 71 | "groupIndex": 0 72 | }, 73 | { 74 | "__type__": "cc.Node", 75 | "_name": "singleColor", 76 | "_objFlags": 0, 77 | "_parent": { 78 | "__id__": 1 79 | }, 80 | "_children": [], 81 | "_tag": -1, 82 | "_active": true, 83 | "_components": [ 84 | { 85 | "__id__": 3 86 | }, 87 | { 88 | "__id__": 4 89 | } 90 | ], 91 | "_prefab": { 92 | "__id__": 5 93 | }, 94 | "_id": "", 95 | "_opacity": 125, 96 | "_color": { 97 | "__type__": "cc.Color", 98 | "r": 0, 99 | "g": 0, 100 | "b": 0, 101 | "a": 255 102 | }, 103 | "_cascadeOpacityEnabled": true, 104 | "_anchorPoint": { 105 | "__type__": "cc.Vec2", 106 | "x": 0.5, 107 | "y": 0.5 108 | }, 109 | "_contentSize": { 110 | "__type__": "cc.Size", 111 | "width": 2000, 112 | "height": 2000 113 | }, 114 | "_rotationX": 0, 115 | "_rotationY": 0, 116 | "_scaleX": 1, 117 | "_scaleY": 1, 118 | "_position": { 119 | "__type__": "cc.Vec2", 120 | "x": 0, 121 | "y": 0 122 | }, 123 | "_skewX": 0, 124 | "_skewY": 0, 125 | "_localZOrder": 0, 126 | "_globalZOrder": 0, 127 | "_opacityModifyRGB": false, 128 | "groupIndex": 0 129 | }, 130 | { 131 | "__type__": "cc.Sprite", 132 | "_name": "", 133 | "_objFlags": 0, 134 | "node": { 135 | "__id__": 2 136 | }, 137 | "_enabled": true, 138 | "_spriteFrame": { 139 | "__uuid__": "410fb916-8721-4663-bab8-34397391ace7" 140 | }, 141 | "_type": 0, 142 | "_sizeMode": 0, 143 | "_fillType": 0, 144 | "_fillCenter": { 145 | "__type__": "cc.Vec2", 146 | "x": 0, 147 | "y": 0 148 | }, 149 | "_fillStart": 0, 150 | "_fillRange": 0, 151 | "_isTrimmedMode": true, 152 | "_srcBlendFactor": 770, 153 | "_dstBlendFactor": 771, 154 | "_atlas": null 155 | }, 156 | { 157 | "__type__": "cc.Widget", 158 | "_name": "", 159 | "_objFlags": 0, 160 | "node": { 161 | "__id__": 2 162 | }, 163 | "_enabled": true, 164 | "isAlignOnce": true, 165 | "_target": null, 166 | "_alignFlags": 45, 167 | "_left": -333, 168 | "_right": -333, 169 | "_top": -625, 170 | "_bottom": -625, 171 | "_verticalCenter": 0, 172 | "_horizontalCenter": 0, 173 | "_isAbsLeft": true, 174 | "_isAbsRight": true, 175 | "_isAbsTop": true, 176 | "_isAbsBottom": true, 177 | "_isAbsHorizontalCenter": true, 178 | "_isAbsVerticalCenter": true, 179 | "_originalWidth": 2, 180 | "_originalHeight": 2 181 | }, 182 | { 183 | "__type__": "cc.PrefabInfo", 184 | "root": { 185 | "__id__": 1 186 | }, 187 | "asset": { 188 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 189 | }, 190 | "fileId": "fcbpwyLVpNKpYk5VcDVlEO", 191 | "sync": false 192 | }, 193 | { 194 | "__type__": "cc.Node", 195 | "_name": "alertBackground", 196 | "_objFlags": 0, 197 | "_parent": { 198 | "__id__": 1 199 | }, 200 | "_children": [ 201 | { 202 | "__id__": 7 203 | }, 204 | { 205 | "__id__": 11 206 | }, 207 | { 208 | "__id__": 16 209 | } 210 | ], 211 | "_tag": -1, 212 | "_active": true, 213 | "_components": [ 214 | { 215 | "__id__": 21 216 | }, 217 | { 218 | "__id__": 22 219 | } 220 | ], 221 | "_prefab": { 222 | "__id__": 23 223 | }, 224 | "_id": "", 225 | "_opacity": 255, 226 | "_color": { 227 | "__type__": "cc.Color", 228 | "r": 255, 229 | "g": 255, 230 | "b": 255, 231 | "a": 255 232 | }, 233 | "_cascadeOpacityEnabled": true, 234 | "_anchorPoint": { 235 | "__type__": "cc.Vec2", 236 | "x": 0.5, 237 | "y": 0.5 238 | }, 239 | "_contentSize": { 240 | "__type__": "cc.Size", 241 | "width": 520, 242 | "height": 317 243 | }, 244 | "_rotationX": 0, 245 | "_rotationY": 0, 246 | "_scaleX": 1, 247 | "_scaleY": 1, 248 | "_position": { 249 | "__type__": "cc.Vec2", 250 | "x": 0, 251 | "y": 0 252 | }, 253 | "_skewX": 0, 254 | "_skewY": 0, 255 | "_localZOrder": 0, 256 | "_globalZOrder": 0, 257 | "_opacityModifyRGB": false, 258 | "groupIndex": 0 259 | }, 260 | { 261 | "__type__": "cc.Node", 262 | "_name": "detailLabel", 263 | "_objFlags": 0, 264 | "_parent": { 265 | "__id__": 6 266 | }, 267 | "_children": [], 268 | "_tag": -1, 269 | "_active": true, 270 | "_components": [ 271 | { 272 | "__id__": 8 273 | }, 274 | { 275 | "__id__": 9 276 | } 277 | ], 278 | "_prefab": { 279 | "__id__": 10 280 | }, 281 | "_id": "", 282 | "_opacity": 255, 283 | "_color": { 284 | "__type__": "cc.Color", 285 | "r": 92, 286 | "g": 25, 287 | "b": 0, 288 | "a": 255 289 | }, 290 | "_cascadeOpacityEnabled": true, 291 | "_anchorPoint": { 292 | "__type__": "cc.Vec2", 293 | "x": 0.5, 294 | "y": 0.5 295 | }, 296 | "_contentSize": { 297 | "__type__": "cc.Size", 298 | "width": 460, 299 | "height": 30 300 | }, 301 | "_rotationX": 0, 302 | "_rotationY": 0, 303 | "_scaleX": 1, 304 | "_scaleY": 1, 305 | "_position": { 306 | "__type__": "cc.Vec2", 307 | "x": 0, 308 | "y": 40 309 | }, 310 | "_skewX": 0, 311 | "_skewY": 0, 312 | "_localZOrder": 0, 313 | "_globalZOrder": 0, 314 | "_opacityModifyRGB": false, 315 | "groupIndex": 0 316 | }, 317 | { 318 | "__type__": "cc.Label", 319 | "_name": "", 320 | "_objFlags": 0, 321 | "node": { 322 | "__id__": 7 323 | }, 324 | "_enabled": true, 325 | "_useOriginalSize": false, 326 | "_actualFontSize": 30, 327 | "_fontSize": 30, 328 | "_lineHeight": 30, 329 | "_enableWrapText": true, 330 | "_N$file": null, 331 | "_isSystemFontUsed": true, 332 | "_spacingX": 0, 333 | "_N$string": "", 334 | "_N$horizontalAlign": 1, 335 | "_N$verticalAlign": 1, 336 | "_N$fontFamily": "Arial", 337 | "_N$overflow": 3 338 | }, 339 | { 340 | "__type__": "cc.Widget", 341 | "_name": "", 342 | "_objFlags": 0, 343 | "node": { 344 | "__id__": 7 345 | }, 346 | "_enabled": true, 347 | "isAlignOnce": true, 348 | "_target": null, 349 | "_alignFlags": 41, 350 | "_left": 30, 351 | "_right": 30, 352 | "_top": 103.5, 353 | "_bottom": 0, 354 | "_verticalCenter": 0, 355 | "_horizontalCenter": 0, 356 | "_isAbsLeft": true, 357 | "_isAbsRight": true, 358 | "_isAbsTop": true, 359 | "_isAbsBottom": true, 360 | "_isAbsHorizontalCenter": true, 361 | "_isAbsVerticalCenter": true, 362 | "_originalWidth": 474, 363 | "_originalHeight": 0 364 | }, 365 | { 366 | "__type__": "cc.PrefabInfo", 367 | "root": { 368 | "__id__": 1 369 | }, 370 | "asset": { 371 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 372 | }, 373 | "fileId": "d323dSi1F5GnbitgoAT0+JT", 374 | "sync": false 375 | }, 376 | { 377 | "__type__": "cc.Node", 378 | "_name": "cancelButton", 379 | "_objFlags": 0, 380 | "_parent": { 381 | "__id__": 6 382 | }, 383 | "_children": [], 384 | "_tag": -1, 385 | "_active": true, 386 | "_components": [ 387 | { 388 | "__id__": 12 389 | }, 390 | { 391 | "__id__": 13 392 | }, 393 | { 394 | "__id__": 14 395 | } 396 | ], 397 | "_prefab": { 398 | "__id__": 15 399 | }, 400 | "_id": "", 401 | "_opacity": 255, 402 | "_color": { 403 | "__type__": "cc.Color", 404 | "r": 255, 405 | "g": 255, 406 | "b": 255, 407 | "a": 255 408 | }, 409 | "_cascadeOpacityEnabled": true, 410 | "_anchorPoint": { 411 | "__type__": "cc.Vec2", 412 | "x": 0.5, 413 | "y": 0.5 414 | }, 415 | "_contentSize": { 416 | "__type__": "cc.Size", 417 | "width": 180, 418 | "height": 70 419 | }, 420 | "_rotationX": 0, 421 | "_rotationY": 0, 422 | "_scaleX": 1, 423 | "_scaleY": 1, 424 | "_position": { 425 | "__type__": "cc.Vec2", 426 | "x": 120, 427 | "y": -75.5 428 | }, 429 | "_skewX": 0, 430 | "_skewY": 0, 431 | "_localZOrder": 0, 432 | "_globalZOrder": 0, 433 | "_opacityModifyRGB": false, 434 | "groupIndex": 0 435 | }, 436 | { 437 | "__type__": "cc.Sprite", 438 | "_name": "", 439 | "_objFlags": 0, 440 | "node": { 441 | "__id__": 11 442 | }, 443 | "_enabled": true, 444 | "_spriteFrame": { 445 | "__uuid__": "e4de196e-de54-4bd2-9e85-539b4bb79c5e" 446 | }, 447 | "_type": 0, 448 | "_sizeMode": 1, 449 | "_fillType": 0, 450 | "_fillCenter": { 451 | "__type__": "cc.Vec2", 452 | "x": 0, 453 | "y": 0 454 | }, 455 | "_fillStart": 0, 456 | "_fillRange": 0, 457 | "_isTrimmedMode": true, 458 | "_srcBlendFactor": 770, 459 | "_dstBlendFactor": 771, 460 | "_atlas": null 461 | }, 462 | { 463 | "__type__": "cc.Button", 464 | "_name": "", 465 | "_objFlags": 0, 466 | "node": { 467 | "__id__": 11 468 | }, 469 | "_enabled": true, 470 | "transition": 3, 471 | "pressedColor": { 472 | "__type__": "cc.Color", 473 | "r": 211, 474 | "g": 211, 475 | "b": 211, 476 | "a": 255 477 | }, 478 | "hoverColor": { 479 | "__type__": "cc.Color", 480 | "r": 255, 481 | "g": 255, 482 | "b": 255, 483 | "a": 255 484 | }, 485 | "duration": 0.1, 486 | "zoomScale": 0.9, 487 | "pressedSprite": null, 488 | "hoverSprite": null, 489 | "clickEvents": [], 490 | "_N$interactable": true, 491 | "_N$enableAutoGrayEffect": false, 492 | "_N$normalColor": { 493 | "__type__": "cc.Color", 494 | "r": 214, 495 | "g": 214, 496 | "b": 214, 497 | "a": 255 498 | }, 499 | "_N$disabledColor": { 500 | "__type__": "cc.Color", 501 | "r": 124, 502 | "g": 124, 503 | "b": 124, 504 | "a": 255 505 | }, 506 | "_N$normalSprite": null, 507 | "_N$disabledSprite": null, 508 | "_N$target": { 509 | "__id__": 11 510 | } 511 | }, 512 | { 513 | "__type__": "cc.Widget", 514 | "_name": "", 515 | "_objFlags": 0, 516 | "node": { 517 | "__id__": 11 518 | }, 519 | "_enabled": true, 520 | "isAlignOnce": true, 521 | "_target": null, 522 | "_alignFlags": 4, 523 | "_left": 0, 524 | "_right": 464, 525 | "_top": 0, 526 | "_bottom": 48, 527 | "_verticalCenter": 0, 528 | "_horizontalCenter": 120, 529 | "_isAbsLeft": true, 530 | "_isAbsRight": true, 531 | "_isAbsTop": true, 532 | "_isAbsBottom": true, 533 | "_isAbsHorizontalCenter": true, 534 | "_isAbsVerticalCenter": true, 535 | "_originalWidth": 0, 536 | "_originalHeight": 0 537 | }, 538 | { 539 | "__type__": "cc.PrefabInfo", 540 | "root": { 541 | "__id__": 1 542 | }, 543 | "asset": { 544 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 545 | }, 546 | "fileId": "0cc7aocYrlMhLrCSNEMpFLJ", 547 | "sync": false 548 | }, 549 | { 550 | "__type__": "cc.Node", 551 | "_name": "enterButton", 552 | "_objFlags": 0, 553 | "_parent": { 554 | "__id__": 6 555 | }, 556 | "_children": [], 557 | "_tag": -1, 558 | "_active": true, 559 | "_components": [ 560 | { 561 | "__id__": 17 562 | }, 563 | { 564 | "__id__": 18 565 | }, 566 | { 567 | "__id__": 19 568 | } 569 | ], 570 | "_prefab": { 571 | "__id__": 20 572 | }, 573 | "_id": "", 574 | "_opacity": 255, 575 | "_color": { 576 | "__type__": "cc.Color", 577 | "r": 255, 578 | "g": 255, 579 | "b": 255, 580 | "a": 255 581 | }, 582 | "_cascadeOpacityEnabled": true, 583 | "_anchorPoint": { 584 | "__type__": "cc.Vec2", 585 | "x": 0.5, 586 | "y": 0.5 587 | }, 588 | "_contentSize": { 589 | "__type__": "cc.Size", 590 | "width": 180, 591 | "height": 70 592 | }, 593 | "_rotationX": 0, 594 | "_rotationY": 0, 595 | "_scaleX": 1, 596 | "_scaleY": 1, 597 | "_position": { 598 | "__type__": "cc.Vec2", 599 | "x": -120, 600 | "y": -75.5 601 | }, 602 | "_skewX": 0, 603 | "_skewY": 0, 604 | "_localZOrder": 0, 605 | "_globalZOrder": 0, 606 | "_opacityModifyRGB": false, 607 | "groupIndex": 0 608 | }, 609 | { 610 | "__type__": "cc.Sprite", 611 | "_name": "", 612 | "_objFlags": 0, 613 | "node": { 614 | "__id__": 16 615 | }, 616 | "_enabled": true, 617 | "_spriteFrame": { 618 | "__uuid__": "8cba795f-f946-41c7-bd49-cc859d0b2897" 619 | }, 620 | "_type": 0, 621 | "_sizeMode": 1, 622 | "_fillType": 0, 623 | "_fillCenter": { 624 | "__type__": "cc.Vec2", 625 | "x": 0, 626 | "y": 0 627 | }, 628 | "_fillStart": 0, 629 | "_fillRange": 0, 630 | "_isTrimmedMode": true, 631 | "_srcBlendFactor": 770, 632 | "_dstBlendFactor": 771, 633 | "_atlas": null 634 | }, 635 | { 636 | "__type__": "cc.Button", 637 | "_name": "", 638 | "_objFlags": 0, 639 | "node": { 640 | "__id__": 16 641 | }, 642 | "_enabled": true, 643 | "transition": 3, 644 | "pressedColor": { 645 | "__type__": "cc.Color", 646 | "r": 211, 647 | "g": 211, 648 | "b": 211, 649 | "a": 255 650 | }, 651 | "hoverColor": { 652 | "__type__": "cc.Color", 653 | "r": 255, 654 | "g": 255, 655 | "b": 255, 656 | "a": 255 657 | }, 658 | "duration": 0.1, 659 | "zoomScale": 0.9, 660 | "pressedSprite": null, 661 | "hoverSprite": null, 662 | "clickEvents": [], 663 | "_N$interactable": true, 664 | "_N$enableAutoGrayEffect": false, 665 | "_N$normalColor": { 666 | "__type__": "cc.Color", 667 | "r": 214, 668 | "g": 214, 669 | "b": 214, 670 | "a": 255 671 | }, 672 | "_N$disabledColor": { 673 | "__type__": "cc.Color", 674 | "r": 124, 675 | "g": 124, 676 | "b": 124, 677 | "a": 255 678 | }, 679 | "_N$normalSprite": null, 680 | "_N$disabledSprite": null, 681 | "_N$target": { 682 | "__id__": 16 683 | } 684 | }, 685 | { 686 | "__type__": "cc.Widget", 687 | "_name": "", 688 | "_objFlags": 0, 689 | "node": { 690 | "__id__": 16 691 | }, 692 | "_enabled": true, 693 | "isAlignOnce": true, 694 | "_target": null, 695 | "_alignFlags": 4, 696 | "_left": 464, 697 | "_right": 0, 698 | "_top": 0, 699 | "_bottom": 48, 700 | "_verticalCenter": 0, 701 | "_horizontalCenter": -120, 702 | "_isAbsLeft": true, 703 | "_isAbsRight": true, 704 | "_isAbsTop": true, 705 | "_isAbsBottom": true, 706 | "_isAbsHorizontalCenter": true, 707 | "_isAbsVerticalCenter": true, 708 | "_originalWidth": 0, 709 | "_originalHeight": 0 710 | }, 711 | { 712 | "__type__": "cc.PrefabInfo", 713 | "root": { 714 | "__id__": 1 715 | }, 716 | "asset": { 717 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 718 | }, 719 | "fileId": "567d9t0QUxPJIv+Jvo/nsE2", 720 | "sync": false 721 | }, 722 | { 723 | "__type__": "cc.Sprite", 724 | "_name": "", 725 | "_objFlags": 0, 726 | "node": { 727 | "__id__": 6 728 | }, 729 | "_enabled": true, 730 | "_spriteFrame": { 731 | "__uuid__": "f226510d-f7be-44b7-b506-46f7302f67bd" 732 | }, 733 | "_type": 1, 734 | "_sizeMode": 0, 735 | "_fillType": 0, 736 | "_fillCenter": { 737 | "__type__": "cc.Vec2", 738 | "x": 0, 739 | "y": 0 740 | }, 741 | "_fillStart": 0, 742 | "_fillRange": 0, 743 | "_isTrimmedMode": true, 744 | "_srcBlendFactor": 770, 745 | "_dstBlendFactor": 771, 746 | "_atlas": null 747 | }, 748 | { 749 | "__type__": "cc.Widget", 750 | "_name": "", 751 | "_objFlags": 0, 752 | "node": { 753 | "__id__": 6 754 | }, 755 | "_enabled": true, 756 | "isAlignOnce": true, 757 | "_target": null, 758 | "_alignFlags": 18, 759 | "_left": 0, 760 | "_right": 0, 761 | "_top": 0, 762 | "_bottom": 0, 763 | "_verticalCenter": 0, 764 | "_horizontalCenter": 0, 765 | "_isAbsLeft": true, 766 | "_isAbsRight": true, 767 | "_isAbsTop": true, 768 | "_isAbsBottom": true, 769 | "_isAbsHorizontalCenter": true, 770 | "_isAbsVerticalCenter": true, 771 | "_originalWidth": 0, 772 | "_originalHeight": 0 773 | }, 774 | { 775 | "__type__": "cc.PrefabInfo", 776 | "root": { 777 | "__id__": 1 778 | }, 779 | "asset": { 780 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 781 | }, 782 | "fileId": "72cfbsbVupCxJjXfv3WMSIX", 783 | "sync": false 784 | }, 785 | { 786 | "__type__": "cc.Widget", 787 | "_name": "", 788 | "_objFlags": 0, 789 | "node": { 790 | "__id__": 1 791 | }, 792 | "_enabled": true, 793 | "isAlignOnce": true, 794 | "_target": null, 795 | "_alignFlags": 18, 796 | "_left": 0, 797 | "_right": 0, 798 | "_top": 0, 799 | "_bottom": 0, 800 | "_verticalCenter": 0, 801 | "_horizontalCenter": 0, 802 | "_isAbsLeft": true, 803 | "_isAbsRight": true, 804 | "_isAbsTop": true, 805 | "_isAbsBottom": true, 806 | "_isAbsHorizontalCenter": true, 807 | "_isAbsVerticalCenter": true, 808 | "_originalWidth": 1334, 809 | "_originalHeight": 750 810 | }, 811 | { 812 | "__type__": "cc.Button", 813 | "_name": "", 814 | "_objFlags": 0, 815 | "node": { 816 | "__id__": 1 817 | }, 818 | "_enabled": true, 819 | "transition": 0, 820 | "pressedColor": { 821 | "__type__": "cc.Color", 822 | "r": 211, 823 | "g": 211, 824 | "b": 211, 825 | "a": 255 826 | }, 827 | "hoverColor": { 828 | "__type__": "cc.Color", 829 | "r": 255, 830 | "g": 255, 831 | "b": 255, 832 | "a": 255 833 | }, 834 | "duration": 0.1, 835 | "zoomScale": 1.2, 836 | "pressedSprite": null, 837 | "hoverSprite": null, 838 | "clickEvents": [], 839 | "_N$interactable": true, 840 | "_N$enableAutoGrayEffect": false, 841 | "_N$normalColor": { 842 | "__type__": "cc.Color", 843 | "r": 214, 844 | "g": 214, 845 | "b": 214, 846 | "a": 255 847 | }, 848 | "_N$disabledColor": { 849 | "__type__": "cc.Color", 850 | "r": 124, 851 | "g": 124, 852 | "b": 124, 853 | "a": 255 854 | }, 855 | "_N$normalSprite": null, 856 | "_N$disabledSprite": null, 857 | "_N$target": { 858 | "__id__": 1 859 | } 860 | }, 861 | { 862 | "__type__": "cc.PrefabInfo", 863 | "root": { 864 | "__id__": 1 865 | }, 866 | "asset": { 867 | "__uuid__": "405535f1-2347-472b-bbc8-25604baa1124" 868 | }, 869 | "fileId": "7cbb2rRetpJ+ZC3lAMKIxy5", 870 | "sync": false 871 | } 872 | ] -------------------------------------------------------------------------------- /assets/resources/Alert.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "405535f1-2347-472b-bbc8-25604baa1124", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /res/raw-assets/JavaScript/Alert.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/res/raw-assets/JavaScript/Alert.js -------------------------------------------------------------------------------- /settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "appKey": "", 3 | "appSecret": "", 4 | "excludeScenes": [], 5 | "includeAnySDK": false, 6 | "includeSDKBox": false, 7 | "includeSdk": [ 8 | "anysdk" 9 | ], 10 | "inlineSpriteFrames": true, 11 | "inlineSpriteFrames_native": true, 12 | "md5Cache": false, 13 | "mergeStartScene": false, 14 | "oauthLoginServer": "", 15 | "optimizeHotUpdate": false, 16 | "orientation": { 17 | "landscapeLeft": true, 18 | "landscapeRight": true, 19 | "portrait": false, 20 | "upsideDown": false 21 | }, 22 | "packageName": "org.cocos2d.CCAlert", 23 | "privateKey": "", 24 | "renderMode": "0", 25 | "startScene": "f623fdd9-deb4-4a4f-9d03-928453787596", 26 | "title": "CCAlert", 27 | "webOrientation": "auto" 28 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "start-scene": "current", 3 | "group-list": [ 4 | "default" 5 | ], 6 | "collision-matrix": [ 7 | [ 8 | true 9 | ] 10 | ], 11 | "excluded-modules": [], 12 | "design-resolution-width": 960, 13 | "design-resolution-height": 640, 14 | "fit-width": false, 15 | "fit-height": true, 16 | "use-project-simulator-setting": false, 17 | "simulator-orientation": false, 18 | "use-customize-simulator": false, 19 | "simulator-resolution": { 20 | "width": 960, 21 | "height": 640 22 | } 23 | } -------------------------------------------------------------------------------- /socket.io/socket.io.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhmbo/CCAlert/479930c1c4d6e54a00968d676ea130f4b58f0a56/socket.io/socket.io.js --------------------------------------------------------------------------------