Răsfoiți Sursa

记录射击

woso_javan 1 lună în urmă
părinte
comite
0045e8a410

+ 1 - 1
assets/module_aliens/Prefabs/cow.prefab

@@ -256,7 +256,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "head",
+    "_name": "Head",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {

+ 9 - 1
assets/module_aliens/Script/LevelAction.ts

@@ -11,6 +11,7 @@ import { tgxUIMgr } from '../../core_tgx/tgx';
 import { UI_BattleGambit } from '../../scripts/UIDef';
 import { CameraSegmentation, moveDuration } from './CamerSegmentation';
 import { TimerMgr } from './Manager/TimerMgr';
+import { LevelManager } from './Manager/LevelMgr';
 
 const { ccclass, property } = _decorator;
 //动画时长
@@ -152,9 +153,14 @@ export class LevelAction extends Component {
             for (let i = 0; i < results.length; i++) {
                 const item = results[i];
                 const hitNode = item.collider.node;
-                console.log(`碰撞物体${i}: ${hitNode.name} 距离: ${item.distance.toFixed(2)}`);
+
+                if(item.collider.getGroup() == 1 << 4) {
+                    LevelManager.instance.levelModel.headshotCount++;
+                }
 
                 if (hitNode.getComponent(EnemyComponent)) {
+                    LevelManager.instance.levelModel.hitCount++;
+                    // console.log(`击中次数: ${LevelManager.instance.levelModel.hitCount} 爆头次数: ${LevelManager.instance.levelModel.headshotCount}`)
                     const levelNode = AliensGlobalInstance.instance.levels.children[0];
                     const remain = levelNode.getChildByName('et')!.children.length;
 
@@ -175,6 +181,8 @@ export class LevelAction extends Component {
                 }
             }
         }
+
+        LevelManager.instance.levelModel.shootCount++;
     }
 
     //相机转向目标

+ 10 - 2
assets/module_aliens/Script/Model/LevelModel.ts

@@ -14,10 +14,15 @@ export class LevelModel {
     /**关卡奖励*/
     public levelReward: number = 0;
 
+    /** 射击次数*/
+    public shootCount: number = 0;
+    /** 击中次数*/
+    public hitCount: number = 0;
+    /** 爆头次数*/
+    public headshotCount: number = 0;
+
     /** 当前关卡等级*/
     public level: number = 1;
-    /** 储存每关星星结算*/
-    public levelStarsMap: Map<number, number> = new Map<number, number>();
     /** 保存可随机的关卡*/
     public randomLevelList: number[] = [];
     /** 输赢*/
@@ -70,6 +75,9 @@ export class LevelModel {
     clearLevel() {
         this.isWin = false;
         this.isEnd = false;
+        this.shootCount = 0;
+        this.hitCount = 0;
+        this.headshotCount = 0;
     }
 
 }

+ 1 - 1
profiles/v2/packages/preview.json

@@ -5,7 +5,7 @@
   },
   "preview": {
     "current": {
-      "platform": "browser"
+      "platform": "gameView"
     }
   }
 }

+ 190 - 190
profiles/v2/packages/scene.json

@@ -5,7 +5,7 @@
     "__version__": "1.3.7"
   },
   "gizmos-infos": {
-    "is2D": true,
+    "is2D": false,
     "is3DIcon": false,
     "iconSize": 2,
     "gridVisible": true,
@@ -837,131 +837,6 @@
       },
       "scale": 1
     },
-    "a07ef603-b66f-4c04-9861-4e659ccba854": {
-      "position": {
-        "x": 14.979588032215515,
-        "y": 6.71311258783352,
-        "z": 14.95155171824655
-      },
-      "rotation": {
-        "x": -0.17319343195252193,
-        "y": 0.3604600212146143,
-        "z": 0.0683036927472506,
-        "w": 0.9140061344337572
-      },
-      "viewCenter": {
-        "x": 0.6695400252948875,
-        "y": -1.5278553540547621,
-        "z": -0.36945263228840375
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 880,
-        "height": 747
-      },
-      "scale": 1
-    },
-    "f631c866-c36b-443f-a8c0-a895176b7610": {
-      "position": {
-        "x": -7.918952283943952,
-        "y": 1.7764639308227288,
-        "z": 1.2126713266100175
-      },
-      "rotation": {
-        "x": -0.07385803242206967,
-        "y": -0.5552882524016344,
-        "z": -0.04960946839957906,
-        "w": 0.8268850273384991
-      },
-      "viewCenter": {
-        "x": 3.306672779868447,
-        "y": -0.40755560018293036,
-        "z": -3.376201393397324
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 880,
-        "height": 747
-      },
-      "scale": 1
-    },
-    "02aebe80-4488-4c7d-9cc6-5b71a0f5351d": {
-      "position": {
-        "x": 2.082080391564877,
-        "y": 2.0820803915648773,
-        "z": 2.0820803915649044
-      },
-      "rotation": {
-        "x": -0.27984814233312133,
-        "y": 0.36470519963100073,
-        "z": 0.11591689595929508,
-        "w": 0.8804762392171495
-      },
-      "viewCenter": {
-        "x": 0,
-        "y": 0,
-        "z": 0
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 880,
-        "height": 743
-      },
-      "scale": 1
-    },
-    "db663f80-626b-46e4-9c02-edc658c45db6": {
-      "position": {
-        "x": 0.8535201109833425,
-        "y": 1.723590297711443,
-        "z": 11.918022489135364
-      },
-      "rotation": {
-        "x": -0.09713398879037521,
-        "y": 0.05206291488639457,
-        "z": 0.0050881438602780535,
-        "w": 0.9938956443748309
-      },
-      "viewCenter": {
-        "x": -2.6563870675303702,
-        "y": -4.906148638226644,
-        "z": -21.49260482425473
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 880,
-        "height": 743
-      },
-      "scale": 1
-    },
-    "9b276317-137b-47c3-846f-5adaae548eff": {
-      "position": {
-        "x": 0.10127668664773637,
-        "y": 3.0315781484035824,
-        "z": 10.842240781986696
-      },
-      "rotation": {
-        "x": -0.07259259193535184,
-        "y": 0.00012568220806444044,
-        "z": 0.000009516122347580526,
-        "w": 0.9973616694607496
-      },
-      "viewCenter": {
-        "x": 0.09833482939486018,
-        "y": 1.322979356219856,
-        "z": -0.8329401802046963
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 880,
-        "height": 743
-      },
-      "scale": 1
-    },
     "e4c2b613-d38f-42e1-9557-74a22acb2cdb": {
       "position": {
         "x": 403.04240188357363,
@@ -1062,56 +937,6 @@
       },
       "scale": 0.9866131191432396
     },
-    "9e293cde-e27b-4902-808b-e884f3e9da32": {
-      "position": {
-        "x": 168.5,
-        "y": 355,
-        "z": 5000
-      },
-      "rotation": {
-        "x": 0,
-        "y": 0,
-        "z": 0,
-        "w": 1
-      },
-      "viewCenter": {
-        "x": 0,
-        "y": 0,
-        "z": 0
-      },
-      "contentRect": {
-        "x": 0,
-        "y": 0,
-        "width": 327,
-        "height": 688.9317507418398
-      },
-      "scale": 0.9703264094955489
-    },
-    "19323c5d-5d36-438a-86ee-8288c690e5b0": {
-      "position": {
-        "x": 0,
-        "y": 0,
-        "z": 5000
-      },
-      "rotation": {
-        "x": 0,
-        "y": 0,
-        "z": 0,
-        "w": 1
-      },
-      "viewCenter": {
-        "x": 0,
-        "y": 0,
-        "z": 0
-      },
-      "contentRect": {
-        "x": -291.5,
-        "y": -367.20151770657674,
-        "width": 0,
-        "height": 0
-      },
-      "scale": 1
-    },
     "d6678b55-2635-45df-bdce-51e04632740e": {
       "position": {
         "x": 361.86530286699747,
@@ -1262,10 +1087,185 @@
       },
       "scale": 0.3119019806539027
     },
+    "02aebe80-4488-4c7d-9cc6-5b71a0f5351d": {
+      "position": {
+        "x": 2.082080391564877,
+        "y": 2.0820803915648773,
+        "z": 2.0820803915649044
+      },
+      "rotation": {
+        "x": -0.27984814233312133,
+        "y": 0.36470519963100073,
+        "z": 0.1159168959592951,
+        "w": 0.8804762392171493
+      },
+      "viewCenter": {
+        "x": 0,
+        "y": 0,
+        "z": 0
+      },
+      "contentRect": {
+        "x": -0.029451137884848322,
+        "y": 5,
+        "width": 880,
+        "height": 747
+      },
+      "scale": 1
+    },
+    "db663f80-626b-46e4-9c02-edc658c45db6": {
+      "position": {
+        "x": 0.7109956281963221,
+        "y": 3.942977720016877,
+        "z": 8.390632786408016
+      },
+      "rotation": {
+        "x": -0.10753776229713433,
+        "y": 0.0592103046936679,
+        "z": 0.006415771633861788,
+        "w": 0.9924155416822885
+      },
+      "viewCenter": {
+        "x": -2.9605227827246194,
+        "y": -2.8284762877548673,
+        "z": -22.268727648174412
+      },
+      "contentRect": {
+        "x": -0.029451137884848322,
+        "y": 5,
+        "width": 880,
+        "height": 747
+      },
+      "scale": 1
+    },
+    "f631c866-c36b-443f-a8c0-a895176b7610": {
+      "position": {
+        "x": -6.702661558126939,
+        "y": 1.4465425250021324,
+        "z": 3.275752357852406
+      },
+      "rotation": {
+        "x": -0.09940131712948956,
+        "y": -0.44795484806171115,
+        "z": -0.05019455168428732,
+        "w": 0.887094323751508
+      },
+      "viewCenter": {
+        "x": -0.7029148247303079,
+        "y": -0.2455327766711657,
+        "z": -1.1501173173647272
+      },
+      "contentRect": {
+        "x": -0.029451137884848322,
+        "y": 5,
+        "width": 880,
+        "height": 747
+      },
+      "scale": 1
+    },
+    "a07ef603-b66f-4c04-9861-4e659ccba854": {
+      "position": {
+        "x": 12.865636379589649,
+        "y": 5.495715707863603,
+        "z": 12.688256550382317
+      },
+      "rotation": {
+        "x": -0.17319343195180173,
+        "y": 0.36046002121337684,
+        "z": 0.06830369274687641,
+        "w": 0.9140061344393422
+      },
+      "viewCenter": {
+        "x": 0.6695400252948875,
+        "y": -1.5278553540547621,
+        "z": -0.36945263228840375
+      },
+      "contentRect": {
+        "x": -0.029451137884848322,
+        "y": 5,
+        "width": 880,
+        "height": 747
+      },
+      "scale": 1
+    },
+    "9b276317-137b-47c3-846f-5adaae548eff": {
+      "position": {
+        "x": 0.10177580742088559,
+        "y": 3.321462081190903,
+        "z": 12.823072905248383
+      },
+      "rotation": {
+        "x": -0.07259259193535184,
+        "y": 0.00012568220806444044,
+        "z": 0.00000951612234758047,
+        "w": 0.9973616694607496
+      },
+      "viewCenter": {
+        "x": 0.09833482939486018,
+        "y": 1.322979356219856,
+        "z": -0.8329401802046963
+      },
+      "contentRect": {
+        "x": -0.029451137884848322,
+        "y": 5,
+        "width": 880,
+        "height": 747
+      },
+      "scale": 1
+    },
+    "19323c5d-5d36-438a-86ee-8288c690e5b0": {
+      "position": {
+        "x": 32.895041018571604,
+        "y": 32.895041018571604,
+        "z": 32.895041018571604
+      },
+      "rotation": {
+        "x": -0.27984814233312133,
+        "y": 0.3647051996310009,
+        "z": 0.11591689595929512,
+        "w": 0.8804762392171493
+      },
+      "viewCenter": {
+        "x": 0,
+        "y": 0,
+        "z": 0
+      },
+      "contentRect": {
+        "x": 0,
+        "y": 0,
+        "width": 335,
+        "height": 707
+      },
+      "scale": 1
+    },
+    "9e293cde-e27b-4902-808b-e884f3e9da32": {
+      "position": {
+        "x": 20.28095929867654,
+        "y": 20.280959298676535,
+        "z": 20.28095929867653
+      },
+      "rotation": {
+        "x": 0,
+        "y": 0,
+        "z": 0,
+        "w": 1
+      },
+      "viewCenter": {
+        "x": 0,
+        "y": 0,
+        "z": 0
+      },
+      "contentRect": {
+        "x": 0,
+        "y": 0,
+        "width": 335,
+        "height": 707
+      },
+      "scale": 1
+    },
     "be14c61f-22d8-4bb9-b444-ad9f29740469": {
       "position": {
-        "x": 846.8805669685673,
-        "y": 1038.5854329990855,
+        "x": 499.19424950456096,
+        "y": 830.4355809059864,
         "z": 5000
       },
       "rotation": {
@@ -1280,12 +1280,12 @@
         "z": 0
       },
       "contentRect": {
-        "x": -1000.2169085857636,
-        "y": -157.92147575145333,
-        "width": 880.0589022757697,
-        "height": 737
+        "x": 0,
+        "y": 0,
+        "width": 335,
+        "height": 707
       },
-      "scale": 0.3063083023755545
+      "scale": 1
     }
   },
   "camera-uuids": [
@@ -1321,23 +1321,23 @@
     "6a3f318c-4d9d-46e4-b3a7-60451b683572",
     "cd016e58-b005-459a-b3dc-4fecf918e910",
     "3f06e1ae-e72f-4b8f-86b5-0cabb0544728",
-    "a07ef603-b66f-4c04-9861-4e659ccba854",
-    "f631c866-c36b-443f-a8c0-a895176b7610",
-    "02aebe80-4488-4c7d-9cc6-5b71a0f5351d",
-    "db663f80-626b-46e4-9c02-edc658c45db6",
-    "9b276317-137b-47c3-846f-5adaae548eff",
     "e4c2b613-d38f-42e1-9557-74a22acb2cdb",
     "773de0b0-468b-4fbb-965c-36c47d7a4c94",
     "4fac1625-c75a-4a5f-96e6-e15ddac448ae",
     "97847f67-f841-48ad-a6b2-6ac8db2fcbfd",
-    "9e293cde-e27b-4902-808b-e884f3e9da32",
-    "19323c5d-5d36-438a-86ee-8288c690e5b0",
     "d6678b55-2635-45df-bdce-51e04632740e",
     "7d719727-ff7f-4ee8-81ed-4ee61f407f45",
     "c9acfa8b-b058-479c-a49b-f885bfb69fb5",
     "c3b52f72-6f4f-4572-9de3-03275df24503",
     "758bb80a-fb60-46ae-baf7-f1835964d75f",
     "b4b51e26-8df9-4c27-a300-00e08cb27bd6",
+    "02aebe80-4488-4c7d-9cc6-5b71a0f5351d",
+    "db663f80-626b-46e4-9c02-edc658c45db6",
+    "f631c866-c36b-443f-a8c0-a895176b7610",
+    "a07ef603-b66f-4c04-9861-4e659ccba854",
+    "9b276317-137b-47c3-846f-5adaae548eff",
+    "19323c5d-5d36-438a-86ee-8288c690e5b0",
+    "9e293cde-e27b-4902-808b-e884f3e9da32",
     "be14c61f-22d8-4bb9-b444-ad9f29740469"
   ],
   "camera": {