Browse Source

修改便于上架

zh 8 tháng trước cách đây
mục cha
commit
66840d8600
43 tập tin đã thay đổi với 710 bổ sung478 xóa
  1. 1 0
      assets/Bundles/Bundle1/Preload/Prefabs/coin.prefab
  2. 3 3
      assets/Bundles/Bundle1/Preload/Prefabs/slot.prefab
  3. 2 2
      assets/scenes/home.scene
  4. 165 165
      assets/scenes/main.scene
  5. 3 5
      assets/scripts/BasePage.ts
  6. 1 1
      assets/scripts/BtnAction.ts
  7. 17 0
      assets/scripts/BucketAction.ts
  8. 0 3
      assets/scripts/CatAction.ts
  9. 0 3
      assets/scripts/CoinsAction.ts
  10. 8 0
      assets/scripts/ColorDate.ts
  11. 23 0
      assets/scripts/DataModel.ts
  12. 0 3
      assets/scripts/DjManger.ts
  13. 4 0
      assets/scripts/ElementAction.ts
  14. 19 1
      assets/scripts/EmptyHoleAction.ts
  15. 0 6
      assets/scripts/Enums.ts
  16. 33 27
      assets/scripts/GameOverAction.ts
  17. 15 8
      assets/scripts/Global.ts
  18. 0 2
      assets/scripts/HoleAction.ts
  19. 37 36
      assets/scripts/HomeAction.ts
  20. 32 28
      assets/scripts/LayerAction.ts
  21. 32 21
      assets/scripts/LayerCatAction.ts
  22. 20 17
      assets/scripts/LayerEmptyAction.ts
  23. 20 18
      assets/scripts/LayerRootAction.ts
  24. 24 11
      assets/scripts/LevelAction.ts
  25. 43 14
      assets/scripts/Main.ts
  26. 13 1
      assets/scripts/MenuAction.ts
  27. 44 31
      assets/scripts/PinAction.ts
  28. 2 0
      assets/scripts/PoolMagr.ts
  29. 8 8
      assets/scripts/ProgressAction.ts
  30. 3 0
      assets/scripts/Props1Action.ts
  31. 6 0
      assets/scripts/Props2Action.ts
  32. 21 8
      assets/scripts/Props3Action.ts
  33. 9 2
      assets/scripts/Props4Action.ts
  34. 4 1
      assets/scripts/PropsAction.ts
  35. 3 0
      assets/scripts/ResMgr.ts
  36. 3 0
      assets/scripts/ShowLevelAction.ts
  37. 3 0
      assets/scripts/SuccessAction.ts
  38. 18 14
      assets/scripts/TipsAction.ts
  39. 16 4
      assets/scripts/Tools.ts
  40. 12 5
      assets/scripts/ad/AdManger.ts
  41. 13 0
      assets/scripts/ad/WxPlatform.ts
  42. 29 29
      assets/scripts/utils/ATAndroidJS2.ts
  43. 1 1
      assets/scripts/utils/EncryptUtil.ts

+ 1 - 0
assets/Bundles/Bundle1/Preload/Prefabs/coin.prefab

@@ -141,6 +141,7 @@
       "__id__": 0
     },
     "fileId": "51LX2x/sZNoY6SDTPSQKyh",
+    "instance": null,
     "targetOverrides": null
   }
 ]

+ 3 - 3
assets/Bundles/Bundle1/Preload/Prefabs/slot.prefab

@@ -704,8 +704,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 110.3369140625,
-      "height": 71.8
+      "width": 101.775390625,
+      "height": 41.8
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -740,7 +740,7 @@
       "b": 255,
       "a": 255
     },
-    "_string": "点 击 开 启\n盒 子",
+    "_string": "open box",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
     "_actualFontSize": 22,

+ 2 - 2
assets/scenes/home.scene

@@ -4812,7 +4812,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 324.140625,
+      "width": 268.078125,
       "height": 41.58
     },
     "_anchorPoint": {
@@ -4842,7 +4842,7 @@
       "b": 255,
       "a": 255
     },
-    "_string": "<<Healthy Gaming Advice>>",
+    "_string": "Healthy Gaming Advice",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
     "_actualFontSize": 24,

+ 165 - 165
assets/scenes/main.scene

@@ -71,10 +71,10 @@
         "__id__": 3
       },
       {
-        "__id__": 56
+        "__id__": 59
       },
       {
-        "__id__": 72
+        "__id__": 75
       },
       {
         "__id__": 169
@@ -181,15 +181,18 @@
       },
       {
         "__id__": 50
+      },
+      {
+        "__id__": 54
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 54
+        "__id__": 57
       },
       {
-        "__id__": 55
+        "__id__": 58
       }
     ],
     "_prefab": null,
@@ -2060,6 +2063,115 @@
     "_lockFlags": 0,
     "_id": "9bzba3b0BGqow9ZQMLiaxx"
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btn_yellow",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 3
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 55
+      },
+      {
+        "__id__": 56
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -522.552,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "3917rIJ3FPiYaNgF2NlPRT"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 54
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 121.8,
+      "height": 60
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "081QOowwxDdJucdjaKdWBK"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 54
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 53,
+      "g": 226,
+      "b": 129,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "cfc0999f-5f28-4c5c-abfa-76e78d34c22e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": "88z1JsvMhD17m6RC9XybRB"
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
@@ -2122,25 +2234,25 @@
     },
     "_children": [
       {
-        "__id__": 57
+        "__id__": 60
       },
       {
-        "__id__": 60
+        "__id__": 63
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 68
+        "__id__": 71
       },
       {
-        "__id__": 69
+        "__id__": 72
       },
       {
-        "__id__": 70
+        "__id__": 73
       },
       {
-        "__id__": 71
+        "__id__": 74
       }
     ],
     "_prefab": null,
@@ -2179,16 +2291,16 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 56
+      "__id__": 59
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 58
+        "__id__": 61
       },
       {
-        "__id__": 59
+        "__id__": 62
       }
     ],
     "_prefab": null,
@@ -2227,7 +2339,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 57
+      "__id__": 60
     },
     "_enabled": true,
     "__prefab": null,
@@ -2249,7 +2361,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 57
+      "__id__": 60
     },
     "_enabled": true,
     "__prefab": null,
@@ -2288,20 +2400,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 56
+      "__id__": 59
     },
     "_children": [
       {
-        "__id__": 61
+        "__id__": 64
       },
       {
-        "__id__": 64
+        "__id__": 67
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 67
+        "__id__": 70
       }
     ],
     "_prefab": null,
@@ -2340,16 +2452,16 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 60
+      "__id__": 63
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 62
+        "__id__": 65
       },
       {
-        "__id__": 63
+        "__id__": 66
       }
     ],
     "_prefab": null,
@@ -2388,7 +2500,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 61
+      "__id__": 64
     },
     "_enabled": true,
     "__prefab": null,
@@ -2410,7 +2522,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 61
+      "__id__": 64
     },
     "_enabled": true,
     "__prefab": null,
@@ -2449,16 +2561,16 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 60
+      "__id__": 63
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 65
+        "__id__": 68
       },
       {
-        "__id__": 66
+        "__id__": 69
       }
     ],
     "_prefab": null,
@@ -2497,7 +2609,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 64
+      "__id__": 67
     },
     "_enabled": true,
     "__prefab": null,
@@ -2519,7 +2631,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 64
+      "__id__": 67
     },
     "_enabled": true,
     "__prefab": null,
@@ -2558,7 +2670,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 60
+      "__id__": 63
     },
     "_enabled": true,
     "__prefab": null,
@@ -2580,7 +2692,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 56
+      "__id__": 59
     },
     "_enabled": true,
     "__prefab": null,
@@ -2602,7 +2714,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 56
+      "__id__": 59
     },
     "_enabled": true,
     "__prefab": null,
@@ -2641,15 +2753,15 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 56
+      "__id__": 59
     },
     "_enabled": true,
     "__prefab": null,
     "level_progress": {
-      "__id__": 57
+      "__id__": 60
     },
     "particle": {
-      "__id__": 60
+      "__id__": 63
     },
     "_id": "3eQH9AqDlCcKpow4UQpHCr"
   },
@@ -2659,7 +2771,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 56
+      "__id__": 59
     },
     "_enabled": true,
     "__prefab": null,
@@ -2693,7 +2805,7 @@
     },
     "_children": [
       {
-        "__id__": 73
+        "__id__": 76
       },
       {
         "__id__": 94
@@ -2750,12 +2862,9 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 72
+      "__id__": 75
     },
     "_children": [
-      {
-        "__id__": 74
-      },
       {
         "__id__": 77
       },
@@ -2814,122 +2923,13 @@
     },
     "_id": "dfcAQb0cZOJaUxf7dOGoch"
   },
-  {
-    "__type__": "cc.Node",
-    "_name": "btn_yellow",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 73
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 75
-      },
-      {
-        "__id__": 76
-      }
-    ],
-    "_prefab": null,
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": -70,
-      "z": 0
-    },
-    "_lrot": {
-      "__type__": "cc.Quat",
-      "x": 0,
-      "y": 0,
-      "z": 0,
-      "w": 1
-    },
-    "_lscale": {
-      "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
-      "z": 1
-    },
-    "_mobility": 0,
-    "_layer": 33554432,
-    "_euler": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_id": "3917rIJ3FPiYaNgF2NlPRT"
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 74
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 121.8,
-      "height": 60
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": "081QOowwxDdJucdjaKdWBK"
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 74
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 53,
-      "g": 226,
-      "b": 129,
-      "a": 255
-    },
-    "_spriteFrame": {
-      "__uuid__": "cfc0999f-5f28-4c5c-abfa-76e78d34c22e@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "_type": 0,
-    "_fillType": 0,
-    "_sizeMode": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_useGrayscale": false,
-    "_atlas": null,
-    "_id": "88z1JsvMhD17m6RC9XybRB"
-  },
   {
     "__type__": "cc.Node",
     "_name": "spriteFrame",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 73
+      "__id__": 76
     },
     "_children": [],
     "_active": true,
@@ -3038,7 +3038,7 @@
     "_objFlags": 512,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 73
+      "__id__": 76
     },
     "_children": [],
     "_active": true,
@@ -3170,7 +3170,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 73
+      "__id__": 76
     },
     "_children": [],
     "_active": true,
@@ -3279,7 +3279,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 73
+      "__id__": 76
     },
     "_children": [],
     "_active": true,
@@ -3388,7 +3388,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 73
+      "__id__": 76
     },
     "_enabled": true,
     "__prefab": null,
@@ -3410,7 +3410,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 73
+      "__id__": 76
     },
     "_enabled": false,
     "__prefab": null,
@@ -3449,7 +3449,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 73
+      "__id__": 76
     },
     "_enabled": true,
     "__prefab": null,
@@ -3507,14 +3507,14 @@
     "_duration": 0.1,
     "_zoomScale": 1.2,
     "_target": {
-      "__id__": 73
+      "__id__": 76
     },
     "_id": "95T7NGqHdMl4Yql4+tRq4p"
   },
   {
     "__type__": "cc.ClickEvent",
     "target": {
-      "__id__": 73
+      "__id__": 76
     },
     "component": "",
     "_componentId": "e58d3p4E0VL26Ah06n+UQ0V",
@@ -3527,7 +3527,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 73
+      "__id__": 76
     },
     "_enabled": true,
     "__prefab": null,
@@ -3539,7 +3539,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 72
+      "__id__": 75
     },
     "_children": [
       {
@@ -5115,7 +5115,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 72
+      "__id__": 75
     },
     "_children": [
       {
@@ -6242,7 +6242,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "__prefab": null,
@@ -6264,7 +6264,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "__prefab": null,
@@ -6276,7 +6276,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "__prefab": null,

+ 3 - 5
assets/scripts/BasePage.ts

@@ -13,7 +13,9 @@ export class BasePage extends Component {
     }
     update(deltaTime: number) {
     }
-    //show menu panel
+    /**
+     * show menu panel
+     */
     open() {
         this.node.active = true;
         this.node.setPosition(0, 0);
@@ -33,7 +35,3 @@ export class BasePage extends Component {
 
 }
 
-//电子邮件puhalskijsemen@gmail.com
-//源码网站 开vpn打开 http://web3incubators.com/
-//电报https://t.me/gamecode999
-

+ 1 - 1
assets/scripts/BtnAction.ts

@@ -13,7 +13,7 @@ export class BtnAction extends Component {
 
     }
 
-    //开启一个空位
+    ////开启一个空位
     unlock_empty_hole() {
         AudioMgr.ins.playSound(Clips.btn_1);
         Global.props_action.open(1);

+ 17 - 0
assets/scripts/BucketAction.ts

@@ -23,12 +23,20 @@ export class BucketAction extends Component {
         this.container.removeAllChildren();
     }
 
+    /**
+     * 
+     * @param pin 
+     */
     public put_pins(pin: PinAction[]) {
         pin.forEach(element => {
             this.put_pin(element);
         });
     }
 
+    /**
+     * 
+     * @param pin 
+     */
     public put_pin(pin: PinAction) {
         let target_hole_pos = new Vec3(Tools.random_between(-20,20),Tools.random_between(-30,30),1);
         //
@@ -47,6 +55,11 @@ export class BucketAction extends Component {
             .start();
     }
 
+    /**
+     * 
+     * @param color_id 
+     * @param pin_arr 
+     */
     public get_pin_arr_by_color_id(color_id:number,pin_arr:PinAction[]){
         this.container.children.forEach(element => {
             if (element.getComponent(PinAction)) {
@@ -58,6 +71,10 @@ export class BucketAction extends Component {
         });
     }
 
+    /**
+     * 
+     * @param pin_arr 
+     */
     public get_pin_arr(pin_arr:PinAction[]){
         this.container.children.forEach(element => {
             if (element.getComponent(PinAction)) {

+ 0 - 3
assets/scripts/CatAction.ts

@@ -31,9 +31,6 @@ export class CatAction extends Component {
 
         this.node.on(Input.EventType.TOUCH_START, this.touch_start, this);
     }
-//电子邮件puhalskijsemen@gmail.com
-//源码网站 开vpn打开 http://web3incubators.com/
-//电报https://t.me/gamecode999
 
 
     init_cat() {

+ 0 - 3
assets/scripts/CoinsAction.ts

@@ -58,7 +58,4 @@ export class CoinsAction extends Component {
 
 }
 
-//电子邮件puhalskijsemen@gmail.com
-//源码网站 开vpn打开 http://web3incubators.com/
-//电报https://t.me/gamecode999
 

+ 8 - 0
assets/scripts/ColorDate.ts

@@ -8,6 +8,14 @@ export class ColorDate  {
     b:number;
     id:number;
 
+    /**
+     * 生产一个颜色对象
+     * @param r 
+     * @param g 
+     * @param b 
+     * @param id 
+     * @returns 
+     */
     public static new_bean(r:number,g:number,b:number,id:number){
         let ret = new ColorDate();
         ret.r = r;

+ 23 - 0
assets/scripts/DataModel.ts

@@ -7,6 +7,29 @@ const { ccclass, property } = _decorator;
 export class DataModel {
     //颜色设置
     public static base_color_arr = [
+        //深青1   	0  0  
+        ColorDate.new_bean(0,238, 0 ,10009),
+        //1
+        ColorDate.new_bean(255,69, 0 ,10008),
+        //171, 177, 187  灰白1
+        ColorDate.new_bean(105,105,105,10002 ), 
+        //11, 246, 235  青1   	  
+        ColorDate.new_bean(202,255,112,10001),
+         //18, 101, 246 绿1  
+         ColorDate.new_bean(162,  205,  90 ,10003),
+        //紫色1    	  	 85 
+        ColorDate.new_bean(186,85, 211 ,10007),
+        //5, 127, 201 浅蓝1  
+        ColorDate.new_bean(0, 154,205,10004),
+        //255, 87, 51 橘红1 	  
+        ColorDate.new_bean(255, 127, 36 ,10006),
+        //255, 195, 黄1
+        ColorDate.new_bean(255,215,0,10005),
+
+    ];
+
+    //备份一下原始的设置
+    public static base_color_arr_back = [
         //深青
         ColorDate.new_bean(13,105, 105 ,10009),
         //💜

+ 0 - 3
assets/scripts/DjManger.ts

@@ -71,9 +71,6 @@ export class DjManger {
         }
         return ret;
     }
-//电子邮件puhalskijsemen@gmail.com
-//源码网站 开vpn打开 http://web3incubators.com/
-//电报https://t.me/gamecode999
 
 
     static return_used_dj(t: string, t_type: string) {

+ 4 - 0
assets/scripts/ElementAction.ts

@@ -21,6 +21,10 @@ export class ElementAction extends Component {
         }
     }
 
+    /**
+     * X关 ,钉子总数  
+     * @returns 
+     */
     public get_hole_num(): number {
         let hole_num: number = 0;
         this.node.children.forEach(element => {

+ 19 - 1
assets/scripts/EmptyHoleAction.ts

@@ -52,7 +52,11 @@ export class EmptyHoleAction extends Component {
         
     }
 
-    //获取钉子
+    /**
+     * 获取钉子
+     * @param arr 
+     * @returns 
+     */
     public get_pin_arr(arr:PinAction[] = null): PinAction[] {
         if(!arr){
             arr = [];
@@ -65,6 +69,11 @@ export class EmptyHoleAction extends Component {
         return arr;
     }
 
+    /**
+     * 
+     * @param color_id 
+     * @param pin_arr 
+     */
     public get_pin_arr_by_color_id(color_id:number,pin_arr:PinAction[]){
         this.node.children.forEach(element => {
             if (element.getComponent(PinAction)) {
@@ -78,6 +87,10 @@ export class EmptyHoleAction extends Component {
 
 
 
+    /**
+     * 
+     * @returns 
+     */
     private get_temp_position(): Vec3 {
         //钉子数量
         let pin_arr = this.get_pin_arr();
@@ -108,6 +121,11 @@ export class EmptyHoleAction extends Component {
             return false;
         }
     }
+    /**
+     * 
+     * @param pin 
+     * @returns 
+     */
 
     public put_pin(pin: PinAction):boolean {
 

+ 0 - 6
assets/scripts/Enums.ts

@@ -1,15 +1,9 @@
-
 import { AudioClip, JsonAsset, Prefab, SpriteAtlas } from "cc";
-
-
-
-
 export const events = {
     check_completed: "check_completed",
     remove_element: "remove_element",
 }
 
-
 /* keys for storage */
 export const Key = {
     Pause: "Pause",

+ 33 - 27
assets/scripts/GameOverAction.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, director, Node, Sprite, tween, Vec3, Widget ,sys} from 'cc';
+import { _decorator, Component, director, Node, Sprite, tween, Vec3, Widget, sys } from 'cc';
 import { AudioMgr } from './AudioMgr';
 import { Clips, DJ, DJ_TYPE } from './Enums';
 import { Global } from './Global';
@@ -33,13 +33,16 @@ export class GameOverAction extends BasePage {
         this.initAdForPage();
     }
 
-    
-    initAdForPage(){
+
+    /**
+     * 
+     */
+    initAdForPage() {
         console.log('zh:initAdForPage for GameOverAction.ts')
-        if(sys.os===sys.OS.ANDROID){
+        if (sys.os === sys.OS.ANDROID) {
             console.log('zh:initAdForPage 1')
             let deviceId = AAJS2.getDeviceUserId();
-            console.log("zh:checkstatus:",ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementId()));
+            console.log("zh:checkstatus:", ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementId()));
             var setting = {};
             setting[ATRewardedVideoSDK.userIdKey] = deviceId;
             ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting);
@@ -51,46 +54,57 @@ export class GameOverAction extends BasePage {
 
     }
 
-    //show menu panel
+    
+    /**
+     * show menu panel
+     * @returns 
+     */
     open() {
-        if(this.node.position.x == 0 && this.node.position.y == 0){
+        if (this.node.position.x == 0 && this.node.position.y == 0) {
             //console.log("打开中,跳过");
             return;
         }
         super.open();
-       
-
         this.fail_img.scale = new Vec3(2, 2, 0);
         tween(this.fail_img)
-            .to(0.3, { scale: new Vec3(1, 1, 0) },Global.our_easing)
+            .to(0.3, { scale: new Vec3(1, 1, 0) }, Global.our_easing)
             .call(() => {
             })
             .start();
 
         this.fail_dou.scale = new Vec3(0.1, 0.1, 0);
         tween(this.fail_dou)
-            .to(0.3, { scale: new Vec3(1, 1, 0) },Global.our_easing)
+            .to(0.3, { scale: new Vec3(1, 1, 0) }, Global.our_easing)
             .call(() => {
             }).start();
 
         AudioMgr.ins.playSound(Clips.fail);
     }
 
-
+    /**
+     * go to home page
+     */
     btn_go_home() {
         this.close();
         director.loadScene("home");
         AdManger.show_interstial();
     }
 
+    /**
+     * restart game
+     */
     btn_restart_game() {
         this.close();
         Global.main_action.restart_game();
         AdManger.show_interstial();
     }
 
-    
-    clear_pins_videos(){
+
+    /**
+     * 
+     * @returns 
+     */
+    clear_pins_videos() {
         console.log('zh:失败了,我要复活。。。')
         AudioMgr.ins.playSound(Clips.btn_1);
         let pin_arr = Global.layer_empty_action.get_pin_arr();
@@ -98,32 +112,26 @@ export class GameOverAction extends BasePage {
             Global.tips_action.show("No Screws to Clear");//没有可清理的钉子
             return;
         }
-        if (!DjManger.use_dj(DJ.Btn_5,DJ_TYPE.Type_video)) {
+        if (!DjManger.use_dj(DJ.Btn_5, DJ_TYPE.Type_video)) {
             Global.tips_action.show("Current Level: Props Exhausted");//当前关卡次数已经用完   
             return;
         }
-        
         // Global.log_dj();
         // this.close();
         // Global.log_dj();
-
-
-        if(sys.os == sys.OS.ANDROID){
-            if(ATRewardedVideoSDK.hasAdReady(AAJS2.getPlacementId())){
+        if (sys.os == sys.OS.ANDROID) {
+            if (ATRewardedVideoSDK.hasAdReady(AAJS2.getPlacementId())) {
                 console.log('zh:继续 ad  ok')
                 sys.localStorage.setItem('yxAdMark', 'fuHuo');//看广告用于 继续 标记
                 ATRewardedVideoSDK.showAd(AAJS2.getPlacementId());
-            }else{
+            } else {
                 console.log('zh:继续 ad  no ok')
-                
+
                 Global.tips_action.show("No reward video for now");//没有奖励视频
                 //this.useCoinsForAdPlayEnd();
             }
         }
 
-
-
-        
         //下面是原始的
         // AdManger.show_video((data) => {
         //     if (data == 1) {
@@ -138,8 +146,6 @@ export class GameOverAction extends BasePage {
         //     } 
         // })
 
-
-
     }
 
 

+ 15 - 8
assets/scripts/Global.ts

@@ -19,8 +19,6 @@ export class Global {
 
     static start = false;
     static LoadingRate = 0;
-
-    //
     static layer_cat_action: LayerCatAction;
     static layer_root_action: LayerRootAction;
     static layer_empty_action: LayerEmptyAction;
@@ -62,10 +60,14 @@ export class Global {
 
     static sound_switch = true;
 
-    //当前获取的的金币
+    /**
+     * 当前获取的的金币
+     */
     static cur_coins = 0;
-    //使用道具需要多少金币
-     private static need_coins = 30;   //zh:diy def =30
+    /**
+     * 使用道具需要多少金币
+     */
+     private static need_coins = 30;   //zh:diy def =30 //zh:diy
 
      public static get_need_coins():number{
         return Global.need_coins*Global.cur_lvl;
@@ -89,7 +91,9 @@ export class Global {
     }
 
 
-    //每关开始前调用
+    /**
+     * 每关开始前调用
+     */
     public static every_level_default() {
         Global.cur_lvl_pin_total = 0;
         Global.cur_lvl_pin_move_num = 0;
@@ -98,10 +102,13 @@ export class Global {
     }
 
     static our_easing: ITweenOption = { easing: 'quadInOut' };
-
-
     static ad_intersitial_id: string;
     static ad_video_id: string;
 
+    /**
+     * 是否是开发测试,zh:diy 注意!上线发布要改为false
+     */
+    static devMark = true;
+
 }
 

+ 0 - 2
assets/scripts/HoleAction.ts

@@ -4,11 +4,9 @@ const { ccclass, property } = _decorator;
 @ccclass('HoleAction')
 export class HoleAction extends Component {
     start() {
-
     }
 
     update(deltaTime: number) {
-        
     }
 }
 

+ 37 - 36
assets/scripts/HomeAction.ts

@@ -14,19 +14,19 @@ const { ccclass, property } = _decorator;
 @ccclass('HomeAction')
 export class HomeAction extends Component {
 
-    @property({type:Node})
-    logo:Node = null;
+    @property({ type: Node })
+    logo: Node = null;
     @property(Sprite)
     load: Sprite = null;
-    @property({type:Node})
-    btns_layer:Node = null;
+    @property({ type: Node })
+    btns_layer: Node = null;
     private isload = true;
     load_num = 0;
 
-    @property({type:String})
-    ad_intersitial_id:string;
-    @property({type:String})
-    ad_video_id:string;
+    @property({ type: String })
+    ad_intersitial_id: string;
+    @property({ type: String })
+    ad_video_id: string;
 
 
 
@@ -42,8 +42,8 @@ export class HomeAction extends Component {
         await this.loadRes();
     }
 
-     async loadRes() {
-        director.preloadScene("main",()=>{
+    async loadRes() {
+        director.preloadScene("main", () => {
             console.log(">>>main scene preload completed!!");
             this.show_btns();
         });
@@ -51,19 +51,22 @@ export class HomeAction extends Component {
         await ResMgr.ins.loadRes(1, AssetType.Prefab, 0.6)
         await ResMgr.ins.loadRes(1, AssetType.Sound, 0.32)
     }
-    
-    start_game(){
+
+    start_game() {
         AudioMgr.ins.playSound(Clips.btn_1);
         director.loadScene("main");
     }
 
+    /**
+     * 显示按钮
+     */
     show_btns() {
         this.load_num++;
-        if(this.load_num>=2){
+        if (this.load_num >= 2) {
             this.load.node.parent.parent.active = false;
             this.btns_layer.active = true;
         }
-        
+
     }
 
 
@@ -72,45 +75,43 @@ export class HomeAction extends Component {
         this.load.fillRange = Global.LoadingRate;
         if (Global.LoadingRate >= 0.99) {
             this.isload = false;
-           this.show_btns();
+            this.show_btns();
         }
     }
 
-    check_lvl_data(){
+    check_lvl_data() {
         console.log("测试数据安全性");
-        for(let lvl=1;lvl<=50;lvl++){
-            let level_prebab = PoolMgr.ins.getPrefab("lvl_"+lvl);
-            if(!level_prebab){
-                console.log(lvl,"没有这个等级");
+        for (let lvl = 1; lvl <= 50; lvl++) {
+            let level_prebab = PoolMgr.ins.getPrefab("lvl_" + lvl);
+            if (!level_prebab) {
+                console.log(lvl, "没有这个等级");
                 break;
             }
             let lvl_node = instantiate(level_prebab);
             let pin_total = lvl_node.getComponent(LevelAction).get_hole_num();
-            console.log(lvl,"关,钉子总数:",pin_total,"取模:",pin_total%3);
-
-
+            console.log(lvl, "关,钉子总数:", pin_total, "取模:", pin_total % 3);
             {
                 lvl_node.children.forEach(layer_node => {
                     // console.log("init_level this.node>>>>>:", this.node);
-                    let layer =   layer_node.getComponent(LayerAction);
-                    if(!layer_node.active){
-                        console.log("错误》〉",lvl,"关 ",layer_node.name," layer 是隐藏的");
+                    let layer = layer_node.getComponent(LayerAction);
+                    if (!layer_node.active) {
+                        console.log("错误》〉", lvl, "关 ", layer_node.name, " layer 是隐藏的");
+                    }
+                    if (!layer) {
+                        console.log("错误》〉", lvl, "关 ", layer_node.name, " layer action错误");
                     }
-                    if(!layer){
-                        console.log("错误》〉",lvl,"关 ",layer_node.name," layer action错误");
-                       }
-                    layer_node.children.forEach(ele_node=>{
-                        if(!ele_node.active){
-                         console.log("错误》〉",lvl,"关 ",layer_node.name," layer 节点>>",ele_node.name," 是隐藏的");
+                    layer_node.children.forEach(ele_node => {
+                        if (!ele_node.active) {
+                            console.log("错误》〉", lvl, "关 ", layer_node.name, " layer 节点>>", ele_node.name, " 是隐藏的");
+                        }
+                        if (!ele_node.getComponent(ElementAction)) {
+                            console.log("错误》〉", lvl, "关 ", layer_node.name, " layer 节点>>", ele_node.name, " action错误");
                         }
-                        if(!ele_node.getComponent(ElementAction)){
-                            console.log("错误》〉",lvl,"关 ",layer_node.name," layer 节点>>",ele_node.name," action错误");
-                           }
                     })
                     // console.log("获取钉子数量:",num,layer_node.active);
                 });
             }
-        } 
+        }
     }
 }
 

+ 32 - 28
assets/scripts/LayerAction.ts

@@ -10,7 +10,7 @@ const { ccclass, property } = _decorator;
 @ccclass('LayerAction')
 export class LayerAction extends Component {
     layer_group_id = 0;
-    layer_color:ColorDate = null;
+    layer_color: ColorDate = null;
     start() {
         console.log("zh:layerAction.ts start");
     }
@@ -18,63 +18,67 @@ export class LayerAction extends Component {
     update(deltaTime: number) {
     }
 
-    public get_hole_num():number{
-        let hole_num:number = 0;
+    public get_hole_num(): number {
+        let hole_num: number = 0;
         this.node.children.forEach(element_node => {
-            hole_num+= element_node.getComponent(ElementAction).get_hole_num();
+            hole_num += element_node.getComponent(ElementAction).get_hole_num();
         });
         return hole_num;
     }
 
-    public init_layer(){
+    public init_layer() {
         this.layer_group_id = DataModel.get_new_group_index();
         this.layer_color = DataModel.get_layer_color();
-
         this.node.children.forEach(element_node => {
-            element_node.getComponent(ElementAction).init_element(this.layer_group_id,this.layer_color);
+            element_node.getComponent(ElementAction).init_element(this.layer_group_id, this.layer_color);
         });
     }
 
-    public init_pin(color_pin_arr:ColorDate[]){
+    public init_pin(color_pin_arr: ColorDate[]) {
         this.node.children.forEach(element_node => {
-            element_node.getComponent(ElementAction).init_pin(this.layer_group_id,color_pin_arr);
+            element_node.getComponent(ElementAction).init_pin(this.layer_group_id, color_pin_arr);
         });
     }
 
-    get_pin_color(arr:PinAction[]){
+    get_pin_color(arr: PinAction[]) {
         this.node.children.forEach(element_node => {
             element_node.getComponent(ElementAction)?.get_pin_color(arr);
         });
     }
 
-    public get_element_size():number{
+    public get_element_size(): number {
         return this.node.children.length;
     }
 
-    public layer_active(active:boolean,t:number=0.3){
+    /**
+     * 
+     * @param active 
+     * @param t 
+     */
+    public layer_active(active: boolean, t: number = 0.3) {
         let need_show = !this.node.active;
         this.node.active = active;
         // this.node.opa
-       let opc_1 = 100;
+        let opc_1 = 100;
         let opc_2 = 200;
-        if(need_show&&active&&this.node.getComponent(UIOpacity)){
+        if (need_show && active && this.node.getComponent(UIOpacity)) {
             this.node.getComponent(UIOpacity).opacity = 0;
             tween(this.node.getComponent(UIOpacity))
-            .to(t, { opacity: opc_1 },Global.our_easing)
-            .to(t, { opacity: opc_2 },Global.our_easing)
-            .to(t, { opacity: opc_1 },Global.our_easing)
-            .to(t, { opacity: opc_2 },Global.our_easing)
-            .to(t, { opacity: opc_1 },Global.our_easing)
-            .to(t, { opacity: opc_2 },Global.our_easing)
-            .to(t, { opacity: opc_1 },Global.our_easing)
-            .to(t, { opacity: 255 },Global.our_easing)
-            
-            .call(()=>{
-                this.node.getComponent(UIOpacity).opacity = 255;
-            })
-            .start();
+                .to(t, { opacity: opc_1 }, Global.our_easing)
+                .to(t, { opacity: opc_2 }, Global.our_easing)
+                .to(t, { opacity: opc_1 }, Global.our_easing)
+                .to(t, { opacity: opc_2 }, Global.our_easing)
+                .to(t, { opacity: opc_1 }, Global.our_easing)
+                .to(t, { opacity: opc_2 }, Global.our_easing)
+                .to(t, { opacity: opc_1 }, Global.our_easing)
+                .to(t, { opacity: 255 }, Global.our_easing)
+
+                .call(() => {
+                    this.node.getComponent(UIOpacity).opacity = 255;
+                })
+                .start();
         }
     }
-        
+
 }
 

+ 32 - 21
assets/scripts/LayerCatAction.ts

@@ -15,54 +15,65 @@ export class LayerCatAction extends Component {
     }
 
     update(deltaTime: number) {
-        
+
     }
 
 
-    //put a pin to slot by pin_color
-    public put_pin(pin:PinAction):boolean{
-        let can_move_arr:CatAction[] = [];
+    /**
+     * put a pin to slot by pin_color
+     * @param pin 
+     * @returns 
+     */
+    public put_pin(pin: PinAction): boolean {
+        let can_move_arr: CatAction[] = [];
         this.node.children.forEach(slot => {
-            if(slot.getComponent(CatAction).check_able_put(pin)){
+            if (slot.getComponent(CatAction).check_able_put(pin)) {
                 can_move_arr.push(slot.getComponent(CatAction));
             }
         });
-        let target:CatAction = null;
+        let target: CatAction = null;
         can_move_arr.forEach(element => {
-            if(!target){
+            if (!target) {
                 target = element;
-            }else{
-                if(element.get_temp_hole_num()<target.get_temp_hole_num()){
+            } else {
+                if (element.get_temp_hole_num() < target.get_temp_hole_num()) {
                     target = element;
                 }
             }
-           
+
         });
-        if(target){
-            return target.put_pin(pin,"LayerSolot");
+        if (target) {
+            return target.put_pin(pin, "LayerSolot");
         }
         return false;
     }
 
-    public init_cat(){
+    /**
+     * 
+     */
+    public init_cat() {
         this.node.children.forEach(slot => {
             slot.getComponent(CatAction)?.init_cat();
             // slot.getComponent(CatAction)?.into_scence();
         });
     }
 
-    public get_cat_color_arr(){
-        let arr:ColorDate[] = [];
+    /**
+     * 
+     * @returns 
+     */
+    public get_cat_color_arr() {
+        let arr: ColorDate[] = [];
         this.node.children.forEach(slot => {
-            if(slot.getComponent(CatAction)){
-               let color =  slot.getComponent(CatAction).get_cat_color();
-               if(color){
-                arr.push(color);
-               }
+            if (slot.getComponent(CatAction)) {
+                let color = slot.getComponent(CatAction).get_cat_color();
+                if (color) {
+                    arr.push(color);
+                }
             }
         });
         return arr;
     }
-    
+
 }
 

+ 20 - 17
assets/scripts/LayerEmptyAction.ts

@@ -19,15 +19,15 @@ export class LayerEmptyAction extends Component {
         });
     }
 
-    public get_pin_arr(arr:PinAction[] = null):PinAction[]{
+    public get_pin_arr(arr: PinAction[] = null): PinAction[] {
         // let arr:PinAction[] = [];
-        if(!arr){
+        if (!arr) {
             arr = [];
         }
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             let empty_hole = this.node.children[i];
             let empty_hole_action = empty_hole.getComponent(EmptyHoleAction);
-            if(empty_hole_action){
+            if (empty_hole_action) {
                 empty_hole_action.get_pin_arr(arr);
             }
         }
@@ -36,9 +36,9 @@ export class LayerEmptyAction extends Component {
 
 
     public put_pin(pin: PinAction) {
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             let empty_hole_action = this.node.children[i].getComponent(EmptyHoleAction);
-            if(empty_hole_action?.can_able_put()){
+            if (empty_hole_action?.can_able_put()) {
                 if (empty_hole_action?.put_pin(pin)) {
                     //放入成功,结束
                     break;
@@ -48,15 +48,15 @@ export class LayerEmptyAction extends Component {
     }
 
     //true = 满了
-    public is_pin_full():boolean{
+    public is_pin_full(): boolean {
         let ret = true;
-        for(let i = 0 ;i<this.node.children.length;i++){
+        for (let i = 0; i < this.node.children.length; i++) {
             let empty_hole = this.node.children[i];
             let empty_hole_action = empty_hole.getComponent(EmptyHoleAction);
-            if(!empty_hole_action){
+            if (!empty_hole_action) {
                 continue;
             }
-            if(empty_hole_action?.can_able_put()){
+            if (empty_hole_action?.can_able_put()) {
                 //还可以放入,结束了
                 ret = false;
                 break;
@@ -66,28 +66,28 @@ export class LayerEmptyAction extends Component {
     }
 
     //check 获取上锁的个数
-    get_unlock_num():number{
+    get_unlock_num(): number {
         let num = 0;
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             // console.log("unlock_empty_hole  i:",i);
             let empty_hole = this.node.children[i];
             let empty_hole_action = empty_hole.getComponent(EmptyHoleAction);
-            if(empty_hole_action?.isLocked){
+            if (empty_hole_action?.isLocked) {
                 num++
             }
         }
         return num;
     }
 
-    
+
     // public get_pin_arr(arr:PinAction[] = null): PinAction[] {
 
-    unlock_empty_hole(){
-        for(let i = this.node.children.length-1;i>=0;i--){
+    unlock_empty_hole() {
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             // console.log("unlock_empty_hole  i:",i);
             let empty_hole = this.node.children[i];
             let empty_hole_action = empty_hole.getComponent(EmptyHoleAction);
-            if(empty_hole_action?.isLocked){
+            if (empty_hole_action?.isLocked) {
                 empty_hole_action.unlock_hole(null);
                 break;
             }
@@ -96,6 +96,9 @@ export class LayerEmptyAction extends Component {
 
 
 
+    /**
+     * 
+     */
     public init_empty() {
         this.node.children.forEach(empty_hole => {
             empty_hole.getComponent(EmptyHoleAction)?.init_empty_hole();

+ 20 - 18
assets/scripts/LayerRootAction.ts

@@ -13,7 +13,7 @@ const { ccclass, property } = _decorator;
 
 @ccclass('LayerRootAction')
 export class LayerRootAction extends Component {
-    lvl_action:LevelAction
+    lvl_action: LevelAction
     update(deltaTime: number) {
     }
 
@@ -33,32 +33,34 @@ export class LayerRootAction extends Component {
         this.lvl_action.init_level();
         this.node.addChild(lvl_node);
     }
-
+    /**
+     * 随机打乱钉子颜色
+     */
     random_pin() {
         let arr: PinAction[] = [];
-        if(this.lvl_action) {
-           arr =  this.lvl_action.get_pin_color();
+        if (this.lvl_action) {
+            arr = this.lvl_action.get_pin_color();
         }
 
         let t = 0.05;
         let y = this.node.getPosition().y;
         tween(this.node)
-            .to(t, { position: new Vec3(30, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(-30, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(30, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(-30, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(20, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(-20, y,0) }, Global.our_easing)
-            .to(t, { position: new Vec3(20, y,0) }, Global.our_easing)
-            .to(t, { position: new Vec3(-20, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(10, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(-10, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(2, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(-2, y,0) },Global.our_easing)
-            .to(t, { position: new Vec3(0, y,0) },Global.our_easing)
+            .to(t, { position: new Vec3(30, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-30, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(30, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-30, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(20, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-20, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(20, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-20, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(10, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-10, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(2, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(-2, y, 0) }, Global.our_easing)
+            .to(t, { position: new Vec3(0, y, 0) }, Global.our_easing)
             .delay(0.3)
             .call(() => {
-                this.node.setPosition(new Vec3(0, y,0));
+                this.node.setPosition(new Vec3(0, y, 0));
 
                 let arr_color: ColorDate[] = [];
                 arr.forEach(element => {

+ 24 - 11
assets/scripts/LevelAction.ts

@@ -34,10 +34,13 @@ export class LevelAction extends Component {
         return hole_num;
     }
 
+    /**
+     * 初始化 关
+     */
     public init_level() {
         //每次开始把基础颜色打乱
         DataModel.random_base_color();
-        DataModel.generate_lvl_color_arr(Global.cur_lvl+4);
+        DataModel.generate_lvl_color_arr(Global.cur_lvl + 4);
         // init every layer
         this.node.children.forEach(layer_node => {
             // console.log("init_level this.node>>>>>:", this.node);
@@ -80,39 +83,49 @@ export class LevelAction extends Component {
         //默认隐藏一些
         this.set_default_layer();
     }
-    
-    set_default_layer(){
+
+    /**
+     * 
+     */
+    set_default_layer() {
         //默认都是不显示的
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             let layer_action = this.node.children[i].getComponent(LayerAction);
             layer_action.node.active = false;
         }
         this.remove_element();
     }
 
-    remove_element(){
+    /**
+     * 移除元素
+     */
+    remove_element() {
         let default_show_layer_num = 4;
         let show_num = 0;
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             let layer_action = this.node.children[i].getComponent(LayerAction);
-            if(layer_action.get_element_size()<=0){
+            if (layer_action.get_element_size() <= 0) {
                 continue;
             }
-            if(show_num<default_show_layer_num){
+            if (show_num < default_show_layer_num) {
                 layer_action.layer_active(true);
                 show_num++;
-            }else{
+            } else {
                 layer_action.layer_active(false);
             }
         }
     }
 
-    get_pin_color():PinAction[]{
+    /**
+     * 
+     * @returns 
+     */
+    get_pin_color(): PinAction[] {
         let arr: PinAction[] = [];
         // this.node.children.forEach(layer_node => {
         //     layer_node.getComponent(LayerAction)?.get_pin_color(arr);
         // });
-        for(let i = this.node.children.length-1;i>=0;i--){
+        for (let i = this.node.children.length - 1; i >= 0; i--) {
             let layer_action = this.node.children[i].getComponent(LayerAction);
             layer_action?.get_pin_color(arr);
         }

+ 43 - 14
assets/scripts/Main.ts

@@ -92,6 +92,9 @@ export class Main extends Component {
         
     }
 
+    /**
+     * 初始化AD
+     */
     initAd() {
 
          //1、清理AD奖励标记
@@ -137,6 +140,7 @@ export class Main extends Component {
 
 
     start() {
+        console.log('zh:main.ts start ')
         Global.layer_root_action = this.layer_root;
         Global.layer_cat_action = this.layer_cat;
         Global.layer_empty_action = this.layer_empty;
@@ -151,10 +155,27 @@ export class Main extends Component {
         Global.props_action = this.props_action;
 
         this.restart_game();
+
+
+    
+
+
+       
+        if(Global.devMark){ 
+           // Global.cur_lvl_pin_total = 5;
+         //   Global.cur_lvl_pin_move_num = 5;
+            //Global.bucket_action.clear_container();
+            Global.cur_lvl=7;
+            Global.cur_coins = 99999;
+        }
+
+
     }
 
     
-    //ad相关的事件初始化
+    /**
+     * ad相关的事件初始化
+     */
     yxAdEventInit() {
         let that = this;
         this.node.on(this.adPalyOverEve_, function (msg) {
@@ -173,7 +194,9 @@ export class Main extends Component {
         });
     }
 
-    // 看完了广告那么就要发放奖励(道具)
+    /**
+     *  看完了广告那么就要发放奖励(道具)
+     */
     yxAdPlayEndAction() {
         let mark = sys.localStorage.getItem(this.yxAdMark);//看广告用于 xx 标记
         console.log('zh:yxAdMark=' + mark);
@@ -225,6 +248,9 @@ export class Main extends Component {
         this.next_lvl();
     }
 
+    /**
+     * 下一关
+     */
     next_lvl() {
         //重置 钉子,金币
         Global.every_level_default();
@@ -236,19 +262,12 @@ export class Main extends Component {
         Global.Show_level_action.show_level();
         Global.coins_action.refrush_coins();
         // Global.layer_root_action.random_pin();
-
-
-
-        let testForDev = false;//zh:diy
-        if(testForDev){ 
-            Global.cur_lvl_pin_total = 1;
-            Global.cur_lvl_pin_move_num = 1;
-            Global.bucket_action.clear_container();
-            Global.cur_lvl=1;
-            Global.cur_coins = 999;
-        }
     }
 
+    /**
+     * 
+     * @param catAction 
+     */
     next_lvlcheck_completed(catAction: CatAction) {
         // Global.success_action.open();return;
         if (Global.cur_lvl_pin_move_num >= Global.cur_lvl_pin_total) {
@@ -260,6 +279,9 @@ export class Main extends Component {
     }
 
 
+    /**
+     * 
+     */
 
     btn_open_menu() {
         AudioMgr.ins.playSound(Clips.btn_1);
@@ -374,4 +396,11 @@ export class Main extends Component {
 window["Main"] = ATRewardedVideoSDK;
 let printLog = function (methodName, placementId, callbackInfo, errorInfo) {
     ATJSSDK.printLogWithParams("AnyThinkRewardedVideoDemo", methodName, placementId, callbackInfo, errorInfo)
-}
+}
+
+
+/**
+ * 
+ *puhalskijsemen@gmail.com 
+ * 
+ */

+ 13 - 1
assets/scripts/MenuAction.ts

@@ -30,7 +30,9 @@ export class MenuAction extends BasePage {
         this.set_xxx();
     }
 
-    //show menu plant
+    /**
+     * show menu plant
+     */
     open() {
         super.open();
         //show interstial
@@ -38,15 +40,25 @@ export class MenuAction extends BasePage {
         this.set_xxx();
     }
 
+    /**
+     * go to home page
+     */
     btn_go_home() {
         this.close();
         director.loadScene("home");
     }
 
+    /**
+     * continue game
+     */
     btn_continue_game() {
         this.close();
     }
 
+    /**
+     * restart game
+     *
+     */
     btn_restart_game() {
         this.close();
         Global.main_action.restart_game();

+ 44 - 31
assets/scripts/PinAction.ts

@@ -10,16 +10,21 @@ const { ccclass, property } = _decorator;
 
 @ccclass('PinAction')
 export class PinAction extends Component {
-    pin_color:ColorDate = null;
+    pin_color: ColorDate = null;
     start() {
         this.node.on(Input.EventType.TOUCH_START, this.touch_start, this);
     }
 
     update(deltaTime: number) {
-        
+
     }
 
-    public init_date(group_id:number,pin_color:ColorDate){
+    /**
+     * 
+     * @param group_id 
+     * @param pin_color 
+     */
+    public init_date(group_id: number, pin_color: ColorDate) {
         this.node.getComponent(RigidBody2D).group = group_id;
         this.node.getComponents(BoxCollider2D).forEach(element => {
             element.group = group_id;
@@ -35,55 +40,63 @@ export class PinAction extends Component {
         this.reset_img();
     }
 
+    /**
+     * 
+     * @param e 
+     * @returns 
+     */
     touch_start(e: EventTouch) {
         AudioMgr.ins.playSound(Clips.open_screw);
         // ret?boolean ,return put result,true=success,false=failure
-        if(Global.layer_cat_action.put_pin(this)){
+        if (Global.layer_cat_action.put_pin(this)) {
             // 需要检查,关卡是否结束
             return;
         }
-       Global.layer_empty_action.put_pin(this);
+        Global.layer_empty_action.put_pin(this);
 
-       if(Global.layer_empty_action.is_pin_full()){
+        if (Global.layer_empty_action.is_pin_full()) {
             //TODO 游戏结束,这里有个bug,用延迟处理,后面处理
-
-            tween(this.node).delay(0.75).call(()=>{
-                if(Global.layer_empty_action.is_pin_full()){
+            tween(this.node).delay(0.75).call(() => {
+                if (Global.layer_empty_action.is_pin_full()) {
                     Global.game_over_action.open();
-                }else{
-                    console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
+                } else {
+                    //console.log("$FFFFFFFFFFFFF");
                 }
-            }).start();  
-       }
-        
+            }).start();
+        }
+
     }
 
 
-    public remove_collider(){
-        this.node.getComponent(RigidBody2D).enabled =false;
+    public remove_collider() {
+        this.node.getComponent(RigidBody2D).enabled = false;
         this.node.getComponent(CircleCollider2D).enabled = false;
         this.node.off(Input.EventType.TOUCH_START);
     }
 
-    reset_img(){
-        if(!this.pin_color){
+    /**
+     * 
+     * @returns void
+     */
+    reset_img() {
+        if (!this.pin_color) {
             return;
         }
         let img = this.node.getComponent(Sprite);
-        img.color = new Color(this.pin_color.r,this.pin_color.g,this.pin_color.b,255);
+        img.color = new Color(this.pin_color.r, this.pin_color.g, this.pin_color.b, 255);
+
+        let holering = this.node.getChildByName("holering")
+        if (holering) {
+            tween(holering)
+                .to(0.35, { scale: new Vec3(1.2, 1.2, 1) }, Global.our_easing)
+                .to(0.35, { scale: new Vec3(0.8, 0.8, 1) }, Global.our_easing)
+                .to(0.25, { scale: new Vec3(1, 1, 1) }, Global.our_easing)
+                .call(() => {
+                    holering.scale = new Vec3(1, 1, 1);
+                })
+                .start();
+        }
 
-       let holering =  this.node.getChildByName("holering")
-       if(holering){
-        tween(holering)
-        .to(0.35,{scale:new Vec3(1.2,1.2,1)},Global.our_easing)
-        .to(0.35,{scale:new Vec3(0.8,0.8,1)},Global.our_easing)
-        .to(0.25,{scale:new Vec3(1,1,1)},Global.our_easing)
-        .call(()=>{
-            holering.scale = new Vec3(1,1,1);
-        })
-        .start();
-       }
-       
     }
 
     // get_pin_color(arr:ColorDate[]){

+ 2 - 0
assets/scripts/PoolMagr.ts

@@ -97,6 +97,8 @@ export class PoolMgr {
         return node;
     }
 
+
+    
     // /**
     //  * @name: 
     //  * @msg: 

+ 8 - 8
assets/scripts/ProgressAction.ts

@@ -5,20 +5,20 @@ const { ccclass, property } = _decorator;
 
 @ccclass('ProgressAction')
 export class ProgressAction extends Component {
-    @property({type:Node})
-    level_progress:Node
-    @property({type:Node})
-    particle:Node
+    @property({ type: Node })
+    level_progress: Node
+    @property({ type: Node })
+    particle: Node
     start() {
     }
 
     update(deltaTime: number) {
-        let data = Global.cur_lvl_pin_move_num/Global.cur_lvl_pin_total;
+        let data = Global.cur_lvl_pin_move_num / Global.cur_lvl_pin_total;
         // console.log("data>>",data);
-        let width = this.level_progress.getComponent(UITransform).contentSize.width; 
-        let add = width*data;
+        let width = this.level_progress.getComponent(UITransform).contentSize.width;
+        let add = width * data;
 
-        this.particle.setPosition(width/2*-1+add,0);
+        this.particle.setPosition(width / 2 * -1 + add, 0);
         this.level_progress.getComponent(Sprite).fillRange = data;
     }
 }

+ 3 - 0
assets/scripts/Props1Action.ts

@@ -32,6 +32,9 @@ export class Props1Action extends Component {
     }
 
 
+    /**
+     * 初始化广告
+     */
     initAdForPage(){
         console.log('zh:initAdForPage foir props1Action.ts')
         if(sys.os===sys.OS.ANDROID){

+ 6 - 0
assets/scripts/Props2Action.ts

@@ -25,6 +25,9 @@ export class Props2Action extends Component {
     @property({ type: Label })
     conis_label: Label;  
 
+    /**
+     * 
+     */
     start() {
         this.conis_label.string = Global.get_need_coins() + "";
         if(this.pin_img_arr){
@@ -36,6 +39,9 @@ export class Props2Action extends Component {
         }
         this.initAdForPage();
     }
+    /**
+     * 初始化广告
+     */
     initAdForPage(){
         console.log('zh:initAdForPage foir props3Action.ts')
         if(sys.os===sys.OS.ANDROID){

+ 21 - 8
assets/scripts/Props3Action.ts

@@ -44,6 +44,9 @@ export class Props3Action extends Component {
         this.initAdForPage();
     }
 
+    /**
+     * 初始化广告
+     */
     initAdForPage(){
         console.log('zh:initAdForPage foir props3Action.ts')
         if(sys.os===sys.OS.ANDROID){
@@ -55,11 +58,6 @@ export class Props3Action extends Component {
         }
     }
 
-//电子邮件puhalskijsemen@gmail.com
-//源码网站 开vpn打开 http://web3incubators.com/
-//电报https://t.me/gamecode999
-
-
     dt:number = 0;
     times:number = 0;
     update(deltaTime: number) {
@@ -100,6 +98,10 @@ export class Props3Action extends Component {
     }
 
 
+    /**
+     * 清理钉子孔
+     * @returns 
+     */
     clear_pins_coins(){
         console.log('zh:clear_pins_coins 11')
         AudioMgr.ins.playSound(Clips.btn_1);
@@ -112,10 +114,15 @@ export class Props3Action extends Component {
             Global.tips_action.show("No Screws to Clear");//没有可清理的钉子
             return;
         }
-        if (!DjManger.use_dj(DJ.Btn_3,DJ_TYPE.Type_coin)) {
-            Global.tips_action.show("Current Level: Props Exhausted");//当前关卡次数已经用完   
-            return;
+    
+        //如果不是开发调试就限制
+        if(!Global.devMark){ 
+            if (!DjManger.use_dj(DJ.Btn_3,DJ_TYPE.Type_coin)) {
+                Global.tips_action.show("Current Level: Props Exhausted");//当前关卡次数已经用完   
+                return;
+            }
         }
+
         console.log('zh:clear_pins_coins 222')
         //消耗
         Global.use_coins(Global.get_need_coins());
@@ -144,6 +151,10 @@ export class Props3Action extends Component {
 
 
 
+    /**
+     * 清理钉子孔
+     * @returns 
+     */
     clear_pins_videos(){
         console.log('zh:clear_pins_videos  111')
 
@@ -153,10 +164,12 @@ export class Props3Action extends Component {
             Global.tips_action.show("No Screws to Clear");//没有可清理的钉子
             return;
         }
+     
         if (!DjManger.use_dj(DJ.Btn_3,DJ_TYPE.Type_video)) {
             Global.tips_action.show("Current Level: Props Exhausted");//当前关卡次数已经用完   
             return;
         }
+       
         console.log('zh:clear_pins_videos  222')
         if(sys.os == sys.OS.ANDROID){
             if(ATRewardedVideoSDK.hasAdReady(AAJS2.getPlacementId())){

+ 9 - 2
assets/scripts/Props4Action.ts

@@ -82,12 +82,15 @@ export class Props4Action extends Component {
         this.cat_img.color = new Color(c.r,c.g,c.b,255);
     }
 
-
+   
     show_box(cat_action:CatAction){
         this.cat_action = cat_action;
     }
 
-    //开启一个盒子
+    /**
+     * 开启一个盒子
+     * @returns 
+     */
     open_box_coins(){
         AudioMgr.ins.playSound(Clips.btn_1);
 
@@ -108,6 +111,10 @@ export class Props4Action extends Component {
         this.node.parent.getComponent(PropsAction)?.close();
     }
 
+    /**
+     * 开启盒子
+     * @returns 
+     */
     open_box_video(){
         AudioMgr.ins.playSound(Clips.btn_1);
         if(!this.cat_action){

+ 4 - 1
assets/scripts/PropsAction.ts

@@ -37,7 +37,10 @@ export class PropsAction extends BasePage {
 
     }
 
-    //show menu 
+    /**
+     * show menu 
+     * @param btn_num 
+     */
     open(btn_num: number = 0) {
         super.open();
         this.set_child_active_false();

+ 3 - 0
assets/scripts/ResMgr.ts

@@ -67,6 +67,9 @@ export default class ResMgr {
                 if (type == AssetType.Prefab) {
                     for (let i = 0; i < assets.length; i++) {
                         asset = assets[i];
+
+                        //console.log("zh:prefab name==", asset.data.name);
+                        //console.log("zh:prefab asset==",asset);
                         PoolMgr.ins.setPrefab(asset.data.name, asset);
                         // Global.Debug && console.log("prefab name==", asset.data.name)
                     }

+ 3 - 0
assets/scripts/ShowLevelAction.ts

@@ -16,6 +16,9 @@ export class ShowLevelAction extends Component {
         
     }
 
+    /**
+     * 显示当前关卡
+     */
     show_level(){
         this.level_label.string = "Level "+ Global.cur_lvl+" ";
     }

+ 3 - 0
assets/scripts/SuccessAction.ts

@@ -38,6 +38,9 @@ export class SuccessAction extends BasePage {
         this.initAdForPage();
     }
 
+    /**
+     * 初始化广告
+     */
     initAdForPage(){
         console.log('zh:initAdForPage foir props1Action.ts')
         if(sys.os===sys.OS.ANDROID){

+ 18 - 14
assets/scripts/TipsAction.ts

@@ -6,33 +6,37 @@ const { ccclass, property } = _decorator;
 
 @ccclass('TipsAction')
 export class TipsAction extends Component {
-    @property({type:Label})
-    level_label:Label = null;
-    msg:string[] = [];
+    @property({ type: Label })
+    level_label: Label = null;
+    msg: string[] = [];
     running = false;
     start() {
         this.set_default();
     }
 
-    set_default(){
-        this.node.setPosition(0,-1000)
+    set_default() {
+        this.node.setPosition(0, -1000)
     }
 
     update(deltaTime: number) {
-        
+
     }
 
-    public show(str:string){
+    public show(str: string) {
         this.msg.push(str);
         // console.log("TipsAction>>>",str,this.level_label);
-        if(!this.running){
+        if (!this.running) {
             this.play();
         }
     }
 
-    private play(){
-        let self  = this;
-        if(self.msg.length == 0){
+    /**
+     * 
+     * @returns 
+     */
+    private play() {
+        let self = this;
+        if (self.msg.length == 0) {
             self.running = false;
             return;
         }
@@ -40,10 +44,10 @@ export class TipsAction extends Component {
         self.level_label.string = self.msg.shift();
         self.set_default();
         tween(self.node)
-            .to(0.35,{position:new Vec3(0,0,0)},Global.our_easing)
+            .to(0.35, { position: new Vec3(0, 0, 0) }, Global.our_easing)
             .delay(1)
-            .to(0.1,{position:new Vec3(0,1000,0)},Global.our_easing)
-            .call(()=>{
+            .to(0.1, { position: new Vec3(0, 1000, 0) }, Global.our_easing)
+            .call(() => {
                 AudioMgr.ins.playSound(Clips.reng);
                 // this.set_default();
                 self.play();

+ 16 - 4
assets/scripts/Tools.ts

@@ -3,21 +3,33 @@ const { ccclass, property } = _decorator;
 
 export class Tools {
 
-    static clearFromParent(node: Node, co:any) {
+    /**
+     * 
+     * @param node 
+     * @param co 
+     */
+    static clearFromParent(node: Node, co: any) {
         let arr = [];
         node.children.forEach(element => {
             if (element.getComponent(co)) {
                 arr.push(element);
             }
         });
-        arr.forEach((element)=>{
+        arr.forEach((element) => {
             element.removeFromParent();
         });
-        
+
     }
 
+
+    /**
+     * 
+     * @param min 
+     * @param max 
+     * @returns 
+     */
     public static random_between(min: number, max: number): number {
         return Math.random() * (max - min) + min;
-        }
+    }
 }
 

+ 12 - 5
assets/scripts/ad/AdManger.ts

@@ -5,6 +5,10 @@ const { ccclass, property } = _decorator;
 @ccclass('AdManger')
 export class AdManger {
 
+    /**
+     * 
+     * @param delay 
+     */
     static show_interstial(delay = 0) {
         const system = sys.platform;
         switch (system) {
@@ -13,8 +17,11 @@ export class AdManger {
                 break;
         }
     }
-    //视频激励广告
-    static show_video(callback:Function) {
+    /**
+     * 视频激励广告
+     * @param callback 
+     */
+    static show_video(callback: Function) {
         console.log('zh:random_pins_videos 666')
         const system = sys.platform;
         switch (system) {
@@ -34,9 +41,9 @@ export class AdManger {
 
                 })
                 break;
-                default:
-                    callback(0);
-                    break;
+            default:
+                callback(0);
+                break;
         }
     }
 }

+ 13 - 0
assets/scripts/ad/WxPlatform.ts

@@ -7,6 +7,10 @@ const { ccclass, property } = _decorator;
 export class WxPlatform {
     static _ins: WxPlatform;
     public wx = window["wx"];
+
+    /**
+     * 
+     */
     static get ins() {
         if (!this._ins) {
             this._ins = new WxPlatform();
@@ -47,6 +51,11 @@ export class WxPlatform {
         })
     }
 
+    /**
+     * 
+     * @param delay 
+     * @returns 
+     */
     show_interstitial(delay = 0) {
         console.log("显示差评广告》〉》〉》〉》〉》〉》〉》");
         if (!WECHAT) {
@@ -77,6 +86,10 @@ export class WxPlatform {
     }
 
     rewardVideo2: any;
+    /**
+     * 
+     * @param callback 
+     */
     show_reward_video(callback: Function) {
         let my = this;
         let ad_video_id = Global.ad_video_id;

+ 29 - 29
assets/scripts/utils/ATAndroidJS2.ts

@@ -8,15 +8,15 @@ const Cocos2dxHelper = "org/cocos2dx/lib/Cocos2dxHelper";
 /**
  * 正式的
  */
-const placementID="n1g03bq8qkeckn";
+const placementID = "n1g03bq8qkeckn";
 /**
  * 测试专用n6729e95f588aa    n66f7c61b71d4c   
  */
-const testPlacementID="n6729e95f588aa"; 
+const testPlacementID = "n6729e95f588aa";
 /**
  * 打砖块的
  */
-const testPlacementIDForDzk="n67122e8932a3d";
+const testPlacementIDForDzk = "n67122e8932a3d";
 
 interface ATAndroidJS {
     getDeviceModel(): string;
@@ -42,17 +42,17 @@ interface ATAndroidJS {
     showGDPRAuth(): void;
     setLogDebug(debug: boolean): void;
     deniedUploadDeviceInfo(deniedInfo: string): void;
-    allInfo():string;
+    allInfo(): string;
     makePostRequestWithXhr: (data: string) => void;
-    getLanguage():string;
-    getInstanceId():string;
-    getInfomation():string;
+    getLanguage(): string;
+    getInstanceId(): string;
+    getInfomation(): string;
     getAdId(): string;
-    getDeviceUserId():string;
-    getPlacementId():string;
+    getDeviceUserId(): string;
+    getPlacementId(): string;
 
     getTestFormApp(): string;
-    getTestFormSdk():string;
+    getTestFormSdk(): string;
 }
 
 
@@ -95,8 +95,8 @@ const ATAndroidJS: ATAndroidJS = {
         return jsb.reflection.callStaticMethod(classJavaParamName, "getAppInstall", "()Ljava/lang/String;");
     },
     getAppInstandId: function () {
-       // return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceId", "()Ljava/lang/String;");
-       return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceIds", "()Ljava/lang/String;");
+        // return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceId", "()Ljava/lang/String;");
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceIds", "()Ljava/lang/String;");
     },
     printJsLog: function (msg: string) {
         if (msg !== undefined && msg !== null) {
@@ -104,7 +104,7 @@ const ATAndroidJS: ATAndroidJS = {
         }
     },
     initSDK: function (appid: string, appkey: string) {
-        console.log('zh:jsb='+jsb)
+        console.log('zh:jsb=' + jsb)
         jsb.reflection.callStaticMethod(classJavaParamName, "initSDK", "(Ljava/lang/String;Ljava/lang/String;)V", appid, appkey);
     },
     initCustomMap: function (customMap: string) {
@@ -144,24 +144,24 @@ const ATAndroidJS: ATAndroidJS = {
     getAdId: function () {
         return jsb.reflection.callStaticMethod(classJavaParamName, "getAdId", "()Ljava/lang/String;");
     },
-    getPlacementId: function(){
-       // return "n66f7c61b71d4c";
-       return testPlacementIDForDzk;
+    getPlacementId: function () {
+        // return "n66f7c61b71d4c";
+        return testPlacementIDForDzk;
     },
 
     getTestFormApp: function () {
         return jsb.reflection.callStaticMethod(classJavaParamNameForApp, "getTestFormApp", "()Ljava/lang/String;");
     },
 
-    getTestFormSdk:function(){
+    getTestFormSdk: function () {
         return jsb.reflection.callStaticMethod(classJavaParamName, "getTestFormSdk", "()Ljava/lang/String;");
     },
-    
+
     /**
      * 本类封装了获取设备所有信息的方法,返回一个json字符串
      * @returns json string
      */
-    allInfo:function() {
+    allInfo: function () {
         const info = {
             systemVersion: this.getSystemVersion(),
             deviceModel: this.getDeviceModel(),
@@ -184,17 +184,17 @@ const ATAndroidJS: ATAndroidJS = {
 
         return JSON.stringify(info);
     },
-    getDeviceUserId: function(){
+    getDeviceUserId: function () {
         return this.getDeviceId()
     },
-  
+
 
     /**
      * 发送HTTP数据到服务器
      * @param data 
      */
-    makePostRequestWithXhr:function( data: string) {
-        var url="https://screwapi.gamefunserver.com/api/game/postData";
+    makePostRequestWithXhr: function (data: string) {
+        var url = "https://screwapi.gamefunserver.com/api/game/postData";
         var xhr = new XMLHttpRequest();
         xhr.open('POST', url, true); // 第三个参数表示异步执行
         xhr.setRequestHeader('Content-Type', 'application/json');
@@ -204,18 +204,18 @@ const ATAndroidJS: ATAndroidJS = {
                 console.log('请求成功:', xhr.responseText);
                 //ATSDK.printLog("zhangsan:请求成功="+xhr.responseText);
             } else {
-                  console.error('请求失败: ' + xhr.status);
-               // ATSDK.printLog("zhangsan:请求失败="+xhr.status);
+                console.error('请求失败: ' + xhr.status);
+                // ATSDK.printLog("zhangsan:请求失败="+xhr.status);
             }
         };
         xhr.onerror = function () {
             console.error('网络请求发生错误');
-           // ATSDK.printLog("zhangsan:网络请求发生错误");    
+            // ATSDK.printLog("zhangsan:网络请求发生错误");    
         };
-       // var data = JSON.stringify({ key1: 'value1', key2: 'value2' });
-        xhr.send(data); 
+        // var data = JSON.stringify({ key1: 'value1', key2: 'value2' });
+        xhr.send(data);
     }
-    
+
 };
 
 export default ATAndroidJS;

+ 1 - 1
assets/scripts/utils/EncryptUtil.ts

@@ -9,7 +9,7 @@ export class EncryptUtil {
         this._key = key;
         this._iv = CryptoES.enc.Hex.parse(iv);
     }
-    
+
     // MD5加密
     static md5(msg: string) {
         return CryptoES.MD5(msg).toString();