Kziwws 4 dagen geleden
bovenliggende
commit
d0073b8624

+ 1 - 1
assets/data/csv/sundries.csv

@@ -3,5 +3,5 @@ number,string,number,number,number
 id,name,hp,explosion_injury,explosion_radius
 11001,沙袋堆,100,,
 11002,油桶,50,100,2.24
-11003,军车,200,300,4.5
+11003,军车,200,300,4.1
 11004,小沙袋,20,,

+ 6 - 12
assets/prefabs/effects/Prefabs/blood.prefab

@@ -35,7 +35,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 0
+      "z": -13.648
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -120,10 +120,7 @@
       "__id__": 4
     },
     "_materials": [
-      {
-        "__uuid__": "c3c4304a-3bdf-487d-83d8-948737745887",
-        "__expectedType__": "cc.Material"
-      },
+      null,
       null
     ],
     "_visFlags": 0,
@@ -238,9 +235,9 @@
     "_mode": 0,
     "color": {
       "__type__": "cc.Color",
-      "r": 255,
-      "g": 49,
-      "b": 49,
+      "r": 202,
+      "g": 0,
+      "b": 0,
       "a": 255
     }
   },
@@ -944,10 +941,7 @@
       "__uuid__": "4686ce4c-b67c-4dc5-97c2-471ba1e2c205@52ff3",
       "__expectedType__": "cc.Mesh"
     },
-    "_cpuMaterial": {
-      "__uuid__": "c3c4304a-3bdf-487d-83d8-948737745887",
-      "__expectedType__": "cc.Material"
-    },
+    "_cpuMaterial": null,
     "_gpuMaterial": null,
     "_mainTexture": null,
     "_useGPU": false,

+ 23 - 116
assets/prefabs/effects/vfx_scene.scene

@@ -56,7 +56,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 611
+      "__id__": 606
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -87,7 +87,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 627
+      "__id__": 619
     },
     "_id": "19486281-e3c1-4739-9220-c9ac2a1c94cb"
   },
@@ -8558,18 +8558,6 @@
       },
       {
         "__id__": 605
-      },
-      {
-        "__id__": 606
-      },
-      {
-        "__id__": 608
-      },
-      {
-        "__id__": 609
-      },
-      {
-        "__id__": 610
       }
     ],
     "removedComponents": []
@@ -8602,7 +8590,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": -13.648
+      "z": 0
     }
   },
   {
@@ -8636,53 +8624,6 @@
       "z": 0
     }
   },
-  {
-    "__type__": "CCPropertyOverrideInfo",
-    "targetInfo": {
-      "__id__": 607
-    },
-    "propertyPath": [
-      "renderer",
-      "_alignSpace"
-    ],
-    "value": 2
-  },
-  {
-    "__type__": "cc.TargetInfo",
-    "localID": [
-      "40upFufY5M5LLdiA+JKJpU"
-    ]
-  },
-  {
-    "__type__": "CCPropertyOverrideInfo",
-    "targetInfo": {
-      "__id__": 607
-    },
-    "propertyPath": [
-      "_simulationSpace"
-    ],
-    "value": 1
-  },
-  {
-    "__type__": "CCPropertyOverrideInfo",
-    "targetInfo": {
-      "__id__": 607
-    },
-    "propertyPath": [
-      "scaleSpace"
-    ],
-    "value": 1
-  },
-  {
-    "__type__": "CCPropertyOverrideInfo",
-    "targetInfo": {
-      "__id__": 602
-    },
-    "propertyPath": [
-      "_active"
-    ],
-    "value": true
-  },
   {
     "__type__": "cc.PrefabInfo",
     "root": null,
@@ -8691,19 +8632,16 @@
     "instance": null,
     "targetOverrides": [
       {
-        "__id__": 612
+        "__id__": 607
       },
       {
-        "__id__": 615
-      },
-      {
-        "__id__": 618
+        "__id__": 610
       },
       {
-        "__id__": 621
+        "__id__": 613
       },
       {
-        "__id__": 624
+        "__id__": 616
       }
     ],
     "nestedPrefabInstanceRoots": [
@@ -8733,7 +8671,7 @@
       "__id__": 10
     },
     "sourceInfo": {
-      "__id__": 613
+      "__id__": 608
     },
     "propertyPath": [
       "_trailModule",
@@ -8743,7 +8681,7 @@
       "__id__": 10
     },
     "targetInfo": {
-      "__id__": 614
+      "__id__": 609
     }
   },
   {
@@ -8764,7 +8702,7 @@
       "__id__": 10
     },
     "sourceInfo": {
-      "__id__": 616
+      "__id__": 611
     },
     "propertyPath": [
       "_trailModule",
@@ -8774,7 +8712,7 @@
       "__id__": 10
     },
     "targetInfo": {
-      "__id__": 617
+      "__id__": 612
     }
   },
   {
@@ -8795,7 +8733,7 @@
       "__id__": 10
     },
     "sourceInfo": {
-      "__id__": 619
+      "__id__": 614
     },
     "propertyPath": [
       "_trailModule",
@@ -8805,7 +8743,7 @@
       "__id__": 10
     },
     "targetInfo": {
-      "__id__": 620
+      "__id__": 615
     }
   },
   {
@@ -8826,7 +8764,7 @@
       "__id__": 10
     },
     "sourceInfo": {
-      "__id__": 622
+      "__id__": 617
     },
     "propertyPath": [
       "_trailModule",
@@ -8836,7 +8774,7 @@
       "__id__": 10
     },
     "targetInfo": {
-      "__id__": 623
+      "__id__": 618
     }
   },
   {
@@ -8851,62 +8789,31 @@
       "46LCjf0RBEub0SIEBGm3fA"
     ]
   },
-  {
-    "__type__": "cc.TargetOverrideInfo",
-    "source": {
-      "__id__": 598
-    },
-    "sourceInfo": {
-      "__id__": 625
-    },
-    "propertyPath": [
-      "_trailModule",
-      "_particleSystem"
-    ],
-    "target": {
-      "__id__": 598
-    },
-    "targetInfo": {
-      "__id__": 626
-    }
-  },
-  {
-    "__type__": "cc.TargetInfo",
-    "localID": [
-      "40upFufY5M5LLdiA+JKJpU"
-    ]
-  },
-  {
-    "__type__": "cc.TargetInfo",
-    "localID": [
-      "40upFufY5M5LLdiA+JKJpU"
-    ]
-  },
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 628
+      "__id__": 620
     },
     "shadows": {
-      "__id__": 629
+      "__id__": 621
     },
     "_skybox": {
-      "__id__": 630
+      "__id__": 622
     },
     "fog": {
-      "__id__": 631
+      "__id__": 623
     },
     "octree": {
-      "__id__": 632
+      "__id__": 624
     },
     "skin": {
-      "__id__": 633
+      "__id__": 625
     },
     "lightProbeInfo": {
-      "__id__": 634
+      "__id__": 626
     },
     "postSettings": {
-      "__id__": 635
+      "__id__": 627
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false

+ 8 - 8
assets/scripts/game/Enemy.ts

@@ -358,7 +358,7 @@ export class Enemy extends BaseExp {
         //动画和回收时间
         let recycleTime: number = 2;
         if(!this.isTank()){
-           this.skeletalAnim.play(EAnimType.die);
+           ResUtil.playSkeletalAnim(this.skeletalAnim,EAnimType.die);
         }else{
             //坦克爆炸后生成爆炸特效 
             ResUtil.playParticle(
@@ -401,16 +401,17 @@ export class Enemy extends BaseExp {
     public showHurt(hpStr: string) {
         if(Game.I.isGameOver || this.isDead) return;
         //敌人流血特效
-        /*ResUtil.playParticle(
+        ResUtil.playParticle(
             `effects/Prefabs/blood`, 
             1, 
+            new Vec3(0.2,0.2,0.2),
             (blood) => { 
                 blood.active = true;
-                blood.parent = this.hurt_num.parent; 
-                const targetPos: Vec3 = this.hurt_num.parent.worldPosition.clone();
-                blood.worldPosition = targetPos;
+                blood.parent = this.enemyNode.parent; 
+                const targetPos: Vec3 = this.enemyNode.worldPosition.clone();
+                blood.worldPosition = new Vec3(targetPos.x,targetPos.y - 0.2,targetPos.z);
             }
-        );*/
+        );
         //创建3D伤害数字
         const n = PoolManager.getNode(this.hurt_num, this.hurt_num.parent);
         let label:Label = n.getComponent(Label);
@@ -580,8 +581,7 @@ export class Enemy extends BaseExp {
                     this.tank_walk.active = false;
                     this.tank_shoot.active = true;
                 } else {
-                    const time: number = 1 / this.data.atk_speed;
-                    ResUtil.playSkeletalAnim(this.skeletalAnim, EAnimType.shoot, time);
+                    ResUtil.playSkeletalAnim(this.skeletalAnim, EAnimType.shoot, this.data.atk_speed);
                 }
                 this.updateDir(Game.I.player.node.worldPosition);
             }

+ 5 - 4
assets/scripts/utils/ResUtil.ts

@@ -1,4 +1,4 @@
-import { _decorator, Asset, Component, Constructor, director, Node, ParticleSystem, Prefab, SceneAsset, setPropertyEnumType, SkeletalAnimation, Sprite, SpriteFrame, tween, UIOpacity, v2, v3, Vec3 } from 'cc';
+import { _decorator, AnimationState, Asset, Constructor, director, Node, ParticleSystem, Prefab, SceneAsset, SkeletalAnimation, Sprite, SpriteFrame, tween, UIOpacity, v2, v3, Vec3 } from 'cc';
 import { Utils } from './Utils';
 import { Constants } from '../data/Constants';
 import { bundleMgr } from '../core/manager/BundleManager';
@@ -256,14 +256,15 @@ export class ResUtil {
         }
         //核心逻辑:通过调整播放速度,使动画总时长等于传入的time
         //公式推导:原始时长 = 播放速度 × 实际播放时间 → 播放速度 = 原始时长 / 目标时长
+        let animState:AnimationState = skeletal.getState(name);
         if(time > 0) {
-            clip.speed = clip.duration / time; 
+            animState.speed = clip.duration / time; 
         }else{//恢复默认速度(避免之前的修改影响后续播放)
-            clip.speed = 1;
+            animState.speed = 1;
         }
         skeletal.play(name);
         if(cb){
-           skeletal.scheduleOnce(cb,time);
+           skeletal.scheduleOnce(cb,time > 0 ? time : clip.duration);
         }
     }
    

+ 1 - 1
profiles/v2/packages/reference-image.json

@@ -3,6 +3,6 @@
   "config": {
     "images": [],
     "sceneUUID": {},
-    "scene": "b824d4a8-95d2-4112-8d63-f7df26c184ee"
+    "scene": "10795865-5525-41fc-8bf7-0e8d6983b214"
   }
 }

File diff suppressed because it is too large
+ 442 - 417
profiles/v2/packages/scene.json


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