Browse Source

模型替换 修改

woso_javan 3 weeks ago
parent
commit
ebc5e8cc3d

BIN
assets/module_aliens/FBX/Model/alien2.fbx


+ 170 - 0
assets/module_aliens/FBX/Model/alien2.fbx.meta

@@ -0,0 +1,170 @@
+{
+  "ver": "2.3.12",
+  "importer": "fbx",
+  "imported": true,
+  "uuid": "78c4bda3-3fed-467e-961f-16173257dcff",
+  "files": [],
+  "subMetas": {
+    "30732": {
+      "importer": "gltf-skeleton",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@30732",
+      "displayName": "",
+      "id": "30732",
+      "name": "UnnamedSkeleton-0.skeleton",
+      "userData": {
+        "gltfIndex": 0,
+        "jointsLength": 27
+      },
+      "ver": "1.0.1",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "fe48d": {
+      "importer": "gltf-mesh",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@fe48d",
+      "displayName": "",
+      "id": "fe48d",
+      "name": "立方体.004.mesh",
+      "userData": {
+        "gltfIndex": 0,
+        "triangleCount": 1448
+      },
+      "ver": "1.1.1",
+      "imported": true,
+      "files": [
+        ".bin",
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "07d75": {
+      "importer": "gltf-mesh",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@07d75",
+      "displayName": "",
+      "id": "07d75",
+      "name": "立方体.001.mesh",
+      "userData": {
+        "gltfIndex": 1,
+        "triangleCount": 88
+      },
+      "ver": "1.1.1",
+      "imported": true,
+      "files": [
+        ".bin",
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f1394": {
+      "importer": "gltf-skeleton",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@f1394",
+      "displayName": "",
+      "id": "f1394",
+      "name": "UnnamedSkeleton-1.skeleton",
+      "userData": {
+        "gltfIndex": 1,
+        "jointsLength": 27
+      },
+      "ver": "1.0.1",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "22e2a": {
+      "importer": "gltf-material",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@22e2a",
+      "displayName": "",
+      "id": "22e2a",
+      "name": "材质.material",
+      "userData": {
+        "gltfIndex": 0
+      },
+      "ver": "1.0.14",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "dd992": {
+      "importer": "gltf-material",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@dd992",
+      "displayName": "",
+      "id": "dd992",
+      "name": "材质.001.material",
+      "userData": {
+        "gltfIndex": 1
+      },
+      "ver": "1.0.14",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "4bb36": {
+      "importer": "gltf-scene",
+      "uuid": "78c4bda3-3fed-467e-961f-16173257dcff@4bb36",
+      "displayName": "",
+      "id": "4bb36",
+      "name": "alien2.prefab",
+      "userData": {
+        "gltfIndex": 0
+      },
+      "ver": "1.0.14",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "imageMetas": [],
+    "fbx": {
+      "smartMaterialEnabled": true
+    },
+    "redirect": "78c4bda3-3fed-467e-961f-16173257dcff@4bb36",
+    "lods": {
+      "enable": false,
+      "hasBuiltinLOD": false,
+      "options": [
+        {
+          "screenRatio": 0.25,
+          "faceCount": 1
+        },
+        {
+          "screenRatio": 0.125,
+          "faceCount": 0.25
+        },
+        {
+          "screenRatio": 0.01,
+          "faceCount": 0.1
+        }
+      ]
+    },
+    "assetFinder": {
+      "meshes": [
+        "78c4bda3-3fed-467e-961f-16173257dcff@fe48d",
+        "78c4bda3-3fed-467e-961f-16173257dcff@07d75"
+      ],
+      "skeletons": [
+        "78c4bda3-3fed-467e-961f-16173257dcff@30732",
+        "78c4bda3-3fed-467e-961f-16173257dcff@f1394"
+      ],
+      "textures": [],
+      "materials": [
+        "78c4bda3-3fed-467e-961f-16173257dcff@22e2a",
+        "78c4bda3-3fed-467e-961f-16173257dcff@dd992"
+      ],
+      "scenes": [
+        "78c4bda3-3fed-467e-961f-16173257dcff@4bb36"
+      ]
+    }
+  }
+}

File diff suppressed because it is too large
+ 320 - 578
assets/module_aliens/Prefabs/Levels/level_1.prefab


File diff suppressed because it is too large
+ 404 - 358
assets/module_aliens/Prefabs/et.prefab


+ 33 - 42
assets/module_aliens/Script/Components/EnemyComponent.ts

@@ -20,9 +20,6 @@ export class EnemyComponent extends Component {
     @property(Node)
     head: Node = null!;
 
-    @property(Node)
-    body: Node = null!;
-
     @property(Node)
     leftHand: Node = null!;
 
@@ -36,19 +33,16 @@ export class EnemyComponent extends Component {
     rightFoot: Node = null!;
 
     @property(Node)
-    leftHandGuge: Node = null!;
-
-    @property(Node)
-    rightHandGuge: Node = null!;
+    eyeRender: Node = null!;
 
     @property(Node)
-    leftFootGuge: Node = null!;
+    bodyRender: Node = null!;
 
-    @property(Node)
-    rightFootGuge: Node = null!;
+    @property(Material)
+    hitEyeMaterial: Material = null!; // 击中眼睛的材质
 
     @property(Material)
-    hitMaterial: Material = null!;
+    hitMaterial: Material = null!; // 击中时身体的材质
 
     currentHp: number = 0;
     status: EnemyStatus = EnemyStatus.LIFE;
@@ -85,12 +79,7 @@ export class EnemyComponent extends Component {
             this.status = EnemyStatus.DIE;
             
             // 修改所有部位材质为击中材质
-            this.changeMaterial(this.head);
-            this.changeMaterial(this.body);
-            this.changeMaterial(this.leftHand);
-            this.changeMaterial(this.rightHand);
-            this.changeMaterial(this.leftFoot);
-            this.changeMaterial(this.rightFoot);
+            this.changeMaterial();
             
             this.playHitTwitch();
             await GameUtil.delay(0.5);
@@ -101,46 +90,48 @@ export class EnemyComponent extends Component {
         }
     }
 
-    private changeMaterial(node: Node) {
-        if (!node || !this.hitMaterial) return;
-        const renderer = node.getComponent(MeshRenderer);
+    private changeMaterial() {
+        if (!this.bodyRender || !this.hitMaterial) return;
+        const renderer = this.bodyRender.getComponent(MeshRenderer);
+        const eyeRenderer = this.eyeRender.getComponent(MeshRenderer);
         if (renderer) {
             renderer.material = this.hitMaterial;
         }
+        if (eyeRenderer) {
+            eyeRenderer.material = this.hitEyeMaterial; 
+        }
     }
-
+    
     // 中枪抽搐效果
     playHitTwitch() {
         // 抖动参数配置
         const shakeConfig = {
-            head: { times: 5, duration: 0.12, axis: 'x' },
-            leftHand: { times: 6, duration: 0.1, axis: 'y' },
-            rightHand: { times: 6, duration: 0.15, axis: 'y' },
-            leftFoot: { times: 4, duration: 0.1, axis: 'y' },
-            rightFoot: { times: 4, duration: 0.1, axis: 'y' }
+            head: { times: 5, duration: 0.12 },
+            leftHand: { times: 6, duration: 0.1 },
+            rightHand: { times: 6, duration: 0.15 },
+            leftFoot: { times: 5, duration: 0.13 },
+            rightFoot: { times: 5, duration: 0.13 }
         };
 
         // 生成随机抖动值
         const getRandomShake = () => (10 + Math.random() * 10) * (Math.random() > 0.5 ? 1 : -1);
 
         // 创建抖动动画函数
-        const createShakeTween = (node: Node, config: { times: number, duration: number, axis: string }) => {
-            const rotation = node.rotation.clone();
+        const createShakeTween = (node: Node, config: { times: number, duration: number }) => {
             const t = tween(node);
-
+            
             for (let i = 0; i < config.times; i++) {
+                const euler = new Vec3();
+                node.rotation.getEulerAngles(euler);
                 const shakeValue = getRandomShake();
-                let newRotation = rotation.clone();
-
-                if (config.axis === 'x') {
-                    newRotation = Quat.fromEuler(new Quat(), -90 + getRandomShake(), rotation.y, rotation.z);
-                } else {
-                    newRotation = Quat.fromEuler(new Quat(), 90, rotation.y + shakeValue, rotation.z);
-                }
-
+                
+                const newEuler = new Vec3(euler.x + shakeValue, euler.y + shakeValue, euler.z);
+                const newRotation = new Quat();
+                Quat.fromEuler(newRotation, newEuler.x, newEuler.y, newEuler.z);
+                
                 t.to(config.duration, { rotation: newRotation });
             }
-
+            
             return t;
         };
 
@@ -148,16 +139,16 @@ export class EnemyComponent extends Component {
         createShakeTween(this.head, shakeConfig.head).start();
 
         // 左手抖动
-        createShakeTween(this.leftHandGuge, shakeConfig.leftHand).start();
+        createShakeTween(this.leftHand, shakeConfig.leftHand).start();
 
         // 右手抖动
-        createShakeTween(this.rightHandGuge, shakeConfig.rightHand).start();
+        createShakeTween(this.rightHand, shakeConfig.rightHand).start();
 
         // 左腿抖动
-        createShakeTween(this.leftFootGuge, shakeConfig.leftFoot).start();
+        createShakeTween(this.leftFoot, shakeConfig.leftFoot).start();
 
         // 右腿抖动
-        createShakeTween(this.rightFootGuge, shakeConfig.rightFoot).start();
+        createShakeTween(this.rightFoot, shakeConfig.rightFoot).start();
     }
 
     protected onDestroy(): void {

+ 6 - 2
assets/module_aliens/Script/LevelAction.ts

@@ -15,6 +15,7 @@ import { LevelManager } from './Manager/LevelMgr';
 import { CAMERA_SPLIT_DURATION } from './Components/BulletComponent';
 import { AliensAudioMgr } from './Manager/AliensAudioMgr';
 import { UserManager } from './Manager/UserMgr';
+import { GlobalConfig } from '../../start/Config/GlobalConfig';
 
 const { ccclass, property } = _decorator;
 //动画时长
@@ -31,7 +32,6 @@ export class LevelAction extends Component {
     public targetNode: Node = null!;
 
     //关卡怪物总数
-    @property({ type: CCFloat, displayName: "怪物总数" })
     public enemyTotal: number = 0;
 
     @property({ type: CCFloat, displayName: "拉近镜头的距离" })
@@ -61,6 +61,7 @@ export class LevelAction extends Component {
         this.initilizeUI();
         this.saveCameraState();
 
+        this.enemyTotal = this.node.getChildByName('Ets')!.children.length;
         EventDispatcher.instance.emit(GameEvent.EVENT_INIT_REMAIN_ENEMY, this.enemyTotal);
     }
 
@@ -118,7 +119,10 @@ export class LevelAction extends Component {
         if (this._isZoomed) return;
 
         // 获取相机前方方向(世界坐标)
-        const magnifyRate = UserManager.instance.userModel.magnifyRate;
+        let magnifyRate = UserManager.instance.userModel.magnifyRate;
+        if(GlobalConfig.isDebug){
+            magnifyRate = 20;
+        }
         console.log('magnifyRate:', magnifyRate);
         const forward = new Vec3(0, 0, -magnifyRate);
         Vec3.transformQuat(forward, forward, this.camera.node.rotation);

+ 1 - 1
assets/module_aliens/Script/Manager/TimerMgr.ts

@@ -136,7 +136,7 @@ export class TimerMgr {
         this.countDownTime = LevelManager.instance.levelModel.levelTime;
         
         if(GlobalConfig.isDebug){
-            this.countDownTime = 5; 
+            this.countDownTime = 50; 
         }
     }
 }

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

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

+ 65 - 121
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,
@@ -1162,80 +1162,67 @@
       },
       "scale": 0.2726269331663144
     },
-    "9e293cde-e27b-4902-808b-e884f3e9da32": {
+    "7cef9a87-b169-4934-a57b-09eafc129e91": {
       "position": {
-<<<<<<< Updated upstream
-        "x": 387.26444990471964,
-        "y": 809.116146427287,
-        "z": 22.237407751077917
-=======
-        "x": -70.31629568881931,
-        "y": 675.4177473847577,
-        "z": 5000
->>>>>>> Stashed changes
+        "x": 0.012109347631593107,
+        "y": 0.09934367362886214,
+        "z": 0.23011984197492613
       },
       "rotation": {
-        "x": 0,
-        "y": 0,
-        "z": 0,
-        "w": 1
+        "x": -0.024553346207521566,
+        "y": 0.06750551137603725,
+        "z": 0.0016617744929758628,
+        "w": 0.9974153486032826
       },
       "viewCenter": {
-        "x": 0,
-        "y": 0,
-        "z": 0
+        "x": -0.09012613974968121,
+        "y": 0.06196523260280718,
+        "z": -0.5217013662340355
       },
       "contentRect": {
-        "x": -583.6758188302526,
-        "y": -409.28405495540585,
-        "width": 363,
-        "height": 767
+        "x": 498.5,
+        "y": 401.5,
+        "width": 997,
+        "height": 803
       },
-      "scale": 0.3535533905932739
+      "scale": 1
     },
-    "19323c5d-5d36-438a-86ee-8288c690e5b0": {
+    "773de0b0-468b-4fbb-965c-36c47d7a4c94": {
       "position": {
-<<<<<<< Updated upstream
-        "x": 79.72083333333333,
-        "y": 169.82083333333333,
-        "z": 5000
-=======
-        "x": 31.957190879364187,
-        "y": 31.957190879364184,
-        "z": 31.957190879364177
->>>>>>> Stashed changes
+        "x": 384.62124135291816,
+        "y": 800.8940294183609,
+        "z": -4.4847178661369655
       },
       "rotation": {
-        "x": 0,
-        "y": 0,
-        "z": 0,
-        "w": 1
+        "x": -0.004849812770910814,
+        "y": 0.1484409126232748,
+        "z": 0.0007279847532087428,
+        "w": 0.9889091185816093
       },
       "viewCenter": {
-        "x": 0,
-        "y": 0,
-        "z": 0
+        "x": 383.520171376476,
+        "y": 800.8572441849009,
+        "z": -8.069727778244971
       },
       "contentRect": {
-<<<<<<< Updated upstream
-        "x": 181.5,
-        "y": 383.49999999999994,
-        "width": 353,
-        "height": 745.8705234159779
+        "x": 498.5,
+        "y": 401.5,
+        "width": 997,
+        "height": 803
       },
-      "scale": 0.9724517906336089
+      "scale": 1
     },
-    "9e293cde-e27b-4902-808b-e884f3e9da32": {
+    "19323c5d-5d36-438a-86ee-8288c690e5b0": {
       "position": {
-        "x": 813.2112232030264,
-        "y": 414.66393442622945,
-        "z": 5000
+        "x": 34.695566602353,
+        "y": 34.695566602353,
+        "z": 34.69556660235299
       },
       "rotation": {
-        "x": 0,
-        "y": 0,
-        "z": 0,
-        "w": 1
+        "x": -0.27984814233312133,
+        "y": 0.3647051996310009,
+        "z": 0.11591689595929512,
+        "w": 0.8804762392171493
       },
       "viewCenter": {
         "x": 0,
@@ -1243,29 +1230,18 @@
         "z": 0
       },
       "contentRect": {
-        "x": 314.71122320302646,
-        "y": 13.163934426229508,
-        "width": 984.5840597758406,
-        "height": 793
-=======
         "x": 0,
         "y": 0,
-        "width": 893,
-        "height": 449
->>>>>>> Stashed changes
+        "width": 363,
+        "height": 767
       },
-      "scale": 0.9875466998754671
+      "scale": 1
     },
-    "be14c61f-22d8-4bb9-b444-ad9f29740469": {
+    "9e293cde-e27b-4902-808b-e884f3e9da32": {
       "position": {
-<<<<<<< Updated upstream
-        "x": 815.5,
-        "y": 419.5,
-=======
-        "x": 491.11436555531407,
-        "y": 926.8980128074734,
->>>>>>> Stashed changes
-        "z": 5000
+        "x": 18.695477141176585,
+        "y": 18.695477141176582,
+        "z": 18.69547714117658
       },
       "rotation": {
         "x": 0,
@@ -1279,67 +1255,35 @@
         "z": 0
       },
       "contentRect": {
-<<<<<<< Updated upstream
-        "x": 323.2079701120797,
-        "y": 23,
-        "width": 997,
-        "height": 803
-=======
         "x": 0,
         "y": 0,
-        "width": 638,
-        "height": 504
+        "width": 363,
+        "height": 767
       },
       "scale": 1
     },
-    "773de0b0-468b-4fbb-965c-36c47d7a4c94": {
+    "be14c61f-22d8-4bb9-b444-ad9f29740469": {
       "position": {
-        "x": 383.81340289194287,
-        "y": 800.1420569336829,
-        "z": -7.555733459796663
+        "x": 815.5,
+        "y": 419.5,
+        "z": 5000
       },
       "rotation": {
-        "x": -0.15455141017171603,
-        "y": 0.12864975562818956,
-        "z": 0.020301982448994633,
-        "w": 0.9793625128109519
-      },
-      "viewCenter": {
-        "x": 383.74753479133125,
-        "y": 800.0595060707147,
-        "z": -7.802121836775414
-      },
-      "contentRect": {
         "x": 0,
         "y": 0,
-        "width": 638,
-        "height": 504
-      },
-      "scale": 1
-    },
-    "7cef9a87-b169-4934-a57b-09eafc129e91": {
-      "position": {
-        "x": 0.1846264016107594,
-        "y": 0.09860338568364145,
-        "z": -0.0030081978521704317
-      },
-      "rotation": {
-        "x": -0.06653452658849814,
-        "y": 0.7331410962808302,
-        "z": 0.07248899273225103,
-        "w": 0.672920972814291
+        "z": 0,
+        "w": 1
       },
       "viewCenter": {
-        "x": -0.5454828110541617,
-        "y": -0.04773610019709219,
-        "z": 0.05964628733113523
+        "x": 0,
+        "y": 0,
+        "z": 0
       },
       "contentRect": {
         "x": 0,
         "y": 0,
-        "width": 638,
-        "height": 504
->>>>>>> Stashed changes
+        "width": 363,
+        "height": 767
       },
       "scale": 1
     }
@@ -1390,11 +1334,11 @@
     "02aebe80-4488-4c7d-9cc6-5b71a0f5351d",
     "f631c866-c36b-443f-a8c0-a895176b7610",
     "e4c2b613-d38f-42e1-9557-74a22acb2cdb",
-    "9e293cde-e27b-4902-808b-e884f3e9da32",
-    "19323c5d-5d36-438a-86ee-8288c690e5b0",
-    "be14c61f-22d8-4bb9-b444-ad9f29740469",
+    "7cef9a87-b169-4934-a57b-09eafc129e91",
     "773de0b0-468b-4fbb-965c-36c47d7a4c94",
-    "7cef9a87-b169-4934-a57b-09eafc129e91"
+    "19323c5d-5d36-438a-86ee-8288c690e5b0",
+    "9e293cde-e27b-4902-808b-e884f3e9da32",
+    "be14c61f-22d8-4bb9-b444-ad9f29740469"
   ],
   "camera": {
     "color": [

Some files were not shown because too many files changed in this diff