Browse Source

1.音效
2. 弹痕

greg 4 years ago
parent
commit
6d292e5694

+ 4 - 4
assets/resources/d3d/Particle/zhuodan.prefab

@@ -29,7 +29,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 0
+      "z": 1
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -40,9 +40,9 @@
     },
     "_lscale": {
       "__type__": "cc.Vec3",
-      "x": 0.337,
-      "y": 0.337,
-      "z": 0.337
+      "x": 0.3,
+      "y": 0.3,
+      "z": 0.3
     },
     "_layer": 1073741824,
     "_euler": {

+ 637 - 4
assets/resources/scenes/FightingScene.scene

@@ -32,6 +32,9 @@
       },
       {
         "__id__": 73
+      },
+      {
+        "__id__": 148
       }
     ],
     "_active": true,
@@ -39,7 +42,7 @@
     "_prefab": null,
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 148
+      "__id__": 200
     },
     "_id": "c2b58d4e-131e-4f1f-afd3-c5565cf05d4e"
   },
@@ -121,6 +124,9 @@
     "RightStartPos": {
       "__id__": 81
     },
+    "monsterZhouDanPrefab": {
+      "__uuid__": "c9cd5b63-55c1-4b4b-a879-565594c3984f"
+    },
     "_id": "e8Wxl9npNAqb6LHvO2/9pr"
   },
   {
@@ -4174,16 +4180,643 @@
       "serializable": false
     }
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "zhuodan",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 149
+      }
+    ],
+    "_prefab": {
+      "__id__": 199
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0.7071067811865475,
+      "y": 0,
+      "z": 0,
+      "w": 0.7071067811865476
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 0.337,
+      "y": 0.337,
+      "z": 0.337
+    },
+    "_layer": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 90,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "c3vrumq15NKazesd83C3Zm"
+  },
+  {
+    "__type__": "cc.ParticleSystemComponent",
+    "_name": "Particle<ParticleSystemComponent>",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 148
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "e3f1912c-c797-4cb9-b62a-837d6396dd98"
+      },
+      null
+    ],
+    "_visFlags": 0,
+    "startColor": {
+      "__id__": 150
+    },
+    "scaleSpace": 1,
+    "startSize3D": false,
+    "startSizeX": {
+      "__id__": 151
+    },
+    "startSize": {
+      "__id__": 151
+    },
+    "startSizeY": {
+      "__id__": 152
+    },
+    "startSizeZ": {
+      "__id__": 153
+    },
+    "startSpeed": {
+      "__id__": 154
+    },
+    "startRotation3D": false,
+    "startRotationX": {
+      "__id__": 155
+    },
+    "startRotationY": {
+      "__id__": 156
+    },
+    "startRotationZ": {
+      "__id__": 157
+    },
+    "startRotation": {
+      "__id__": 157
+    },
+    "startDelay": {
+      "__id__": 158
+    },
+    "startLifetime": {
+      "__id__": 159
+    },
+    "duration": 1,
+    "loop": false,
+    "simulationSpeed": 1,
+    "playOnAwake": false,
+    "gravityModifier": {
+      "__id__": 160
+    },
+    "rateOverTime": {
+      "__id__": 161
+    },
+    "rateOverDistance": {
+      "__id__": 162
+    },
+    "bursts": [],
+    "_colorOverLifetimeModule": {
+      "__id__": 163
+    },
+    "_shapeModule": {
+      "__id__": 165
+    },
+    "_sizeOvertimeModule": {
+      "__id__": 167
+    },
+    "_velocityOvertimeModule": {
+      "__id__": 172
+    },
+    "_forceOvertimeModule": {
+      "__id__": 177
+    },
+    "_limitVelocityOvertimeModule": {
+      "__id__": 181
+    },
+    "_rotationOvertimeModule": {
+      "__id__": 186
+    },
+    "_textureAnimationModule": {
+      "__id__": 190
+    },
+    "_trailModule": {
+      "__id__": 193
+    },
+    "renderer": {
+      "__id__": 198
+    },
+    "enableCulling": false,
+    "_prewarm": false,
+    "_capacity": 1,
+    "_simulationSpace": 1,
+    "_id": "891dGUREJEApYfIYMaSGb7"
+  },
+  {
+    "__type__": "cc.GradientRange",
+    "_mode": 0,
+    "color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    }
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0.1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.ColorOvertimeModule",
+    "_enable": false,
+    "color": {
+      "__id__": 164
+    }
+  },
+  {
+    "__type__": "cc.GradientRange",
+    "_mode": 0,
+    "color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    }
+  },
+  {
+    "__type__": "cc.ShapeModule",
+    "_enable": true,
+    "_shapeType": 2,
+    "shapeType": 2,
+    "emitFrom": 0,
+    "alignToDirection": false,
+    "randomDirectionAmount": 0,
+    "sphericalDirectionAmount": 0,
+    "randomPositionAmount": 0,
+    "radius": 1,
+    "radiusThickness": 1,
+    "arcMode": 0,
+    "arcSpread": 0,
+    "arcSpeed": {
+      "__id__": 166
+    },
+    "length": 5,
+    "boxThickness": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_rotation": {
+      "__type__": "cc.Vec3",
+      "x": 90,
+      "y": 90,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_arc": 6.283185307179586,
+    "_angle": 0.4363323129985824
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.SizeOvertimeModule",
+    "_enable": false,
+    "separateAxes": false,
+    "size": {
+      "__id__": 168
+    },
+    "x": {
+      "__id__": 169
+    },
+    "y": {
+      "__id__": 170
+    },
+    "z": {
+      "__id__": 171
+    }
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.VelocityOvertimeModule",
+    "_enable": false,
+    "x": {
+      "__id__": 173
+    },
+    "y": {
+      "__id__": 174
+    },
+    "z": {
+      "__id__": 175
+    },
+    "speedModifier": {
+      "__id__": 176
+    },
+    "space": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.ForceOvertimeModule",
+    "_enable": false,
+    "x": {
+      "__id__": 178
+    },
+    "y": {
+      "__id__": 179
+    },
+    "z": {
+      "__id__": 180
+    },
+    "space": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.LimitVelocityOvertimeModule",
+    "_enable": false,
+    "limitX": {
+      "__id__": 182
+    },
+    "limitY": {
+      "__id__": 183
+    },
+    "limitZ": {
+      "__id__": 184
+    },
+    "limit": {
+      "__id__": 185
+    },
+    "dampen": 3,
+    "separateAxes": false,
+    "space": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.RotationOvertimeModule",
+    "_enable": false,
+    "_separateAxes": false,
+    "x": {
+      "__id__": 187
+    },
+    "y": {
+      "__id__": 188
+    },
+    "z": {
+      "__id__": 189
+    }
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.TextureAnimationModule",
+    "_enable": true,
+    "_numTilesX": 3,
+    "numTilesX": 3,
+    "_numTilesY": 1,
+    "numTilesY": 1,
+    "_mode": 0,
+    "animation": 0,
+    "frameOverTime": {
+      "__id__": 191
+    },
+    "startFrame": {
+      "__id__": 192
+    },
+    "cycleCount": 1,
+    "_flipU": 0,
+    "_flipV": 0,
+    "_uvChannelMask": -1,
+    "randomRow": false,
+    "rowIndex": 0
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 1,
+    "curve": {
+      "__type__": "cc.AnimationCurve",
+      "preWrapMode": 2,
+      "postWrapMode": 2,
+      "keyFrames": [
+        {
+          "__type__": "cc.Keyframe",
+          "time": 0,
+          "value": 0,
+          "inTangent": 1,
+          "outTangent": 1
+        },
+        {
+          "__type__": "cc.Keyframe",
+          "time": 1,
+          "value": 1,
+          "inTangent": 1,
+          "outTangent": 1
+        }
+      ]
+    },
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.TrailModule",
+    "_enable": false,
+    "mode": 0,
+    "lifeTime": {
+      "__id__": 194
+    },
+    "_minParticleDistance": 0.1,
+    "existWithParticles": true,
+    "textureMode": 0,
+    "widthFromParticle": true,
+    "widthRatio": {
+      "__id__": 195
+    },
+    "colorFromParticle": false,
+    "colorOverTrail": {
+      "__id__": 196
+    },
+    "colorOvertime": {
+      "__id__": 197
+    },
+    "_space": 0,
+    "_particleSystem": {
+      "__id__": 149
+    }
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 1,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.CurveRange",
+    "mode": 0,
+    "constant": 0,
+    "multiplier": 1
+  },
+  {
+    "__type__": "cc.GradientRange",
+    "_mode": 0,
+    "color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    }
+  },
+  {
+    "__type__": "cc.GradientRange",
+    "_mode": 0,
+    "color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    }
+  },
+  {
+    "__type__": "cc.ParticleSystemRenderer",
+    "_renderMode": 0,
+    "_velocityScale": 1,
+    "_lengthScale": 1,
+    "_mesh": null,
+    "_mainTexture": {
+      "__uuid__": "83610118-9164-4e54-bc67-660b28ba9610@6c48a"
+    },
+    "_useGPU": false
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 148
+    },
+    "asset": {
+      "__uuid__": "c9cd5b63-55c1-4b4b-a879-565594c3984f"
+    },
+    "fileId": "31u45JhTNEE6Vj5BH4gSHQ",
+    "sync": false,
+    "_synced": true
+  },
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 149
+      "__id__": 201
     },
     "planarShadows": {
-      "__id__": 150
+      "__id__": 202
     },
     "_skybox": {
-      "__id__": 151
+      "__id__": 203
     }
   },
   {

+ 0 - 3
assets/resources/ui/FightingUI.prefab

@@ -5828,9 +5828,6 @@
     "levelLabel": {
       "__id__": 56
     },
-    "combatMusic": {
-      "__uuid__": "338b5cd3-c4f1-4497-badf-e44281c34d19"
-    },
     "_id": ""
   },
   {

+ 7 - 1
assets/scripts/games/scenes/FightingScene.ts

@@ -61,7 +61,13 @@ export class FightingScene extends Component {
     })
     RightStartPos:Node=null;
     
-
+     /**
+     * 怪物弹坑
+     */
+    @property({
+        type:Prefab
+    })
+    monsterZhouDanPrefab:Prefab=null;
 
     onLoad(){
         console.log("进入Fighting场景");

+ 7 - 0
assets/scripts/games/ui/fightings/GameController.ts

@@ -46,6 +46,11 @@ export class GameController extends EventDispatcher{
     public middleMonsterList:MonsterBase[];
     public rightMonsterList:MonsterBase[];
 
+    /**
+     * 怪物弹痕预制体
+     */
+    public monsterZhouDanPrefab:Prefab;
+
     /**
      * 怪物血条层
      */
@@ -101,6 +106,8 @@ export class GameController extends EventDispatcher{
         this.middleEndNode=sceneScript.MiddleEndPos;
         this.rightEndNode=sceneScript.RightEndPos;
 
+        this.monsterZhouDanPrefab=sceneScript.monsterZhouDanPrefab;
+
         this.weapon=this.CreateWeapon(sceneScript.leftHand,sceneScript.rightHand);
         this.StartGame();
     }

+ 19 - 1
assets/scripts/games/ui/fightings/monsters/MonsterBase.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, Node, log, AnimationComponent, RigidBodyComponent, Vec3, find } from 'cc';
+import { _decorator, Component, Node, log, AnimationComponent, RigidBodyComponent, Vec3, find, ParticleSystemComponent, instantiate } from 'cc';
 import { SoundManager } from '../../../../engines/sounds/SoundManager';
 import CCSAnimationUtils from '../../../../engines/utils/CCSAnimationUtils';
 import GameConfigManager from '../../../models/GameConfigManager';
@@ -38,6 +38,11 @@ export class MonsterBase extends Component {
      * 攻击类型 0攻击栅栏 1攻击玩家
      */
     private attackType:number=0;
+
+    /**
+     * 弹痕粒子
+     */
+    private danHen:ParticleSystemComponent;
     
     start () {
         this.monsterConfig=GameConfigManager.GetMonsterConfig(this.config.monsterId);
@@ -192,6 +197,8 @@ export class MonsterBase extends Component {
             }
             this.animation.on(AnimationComponent.EventType.FINISHED,this.DamageComplete,this,true);
             this.animation.play(this.monsterConfig.damageAnimation);
+
+            //音效
             let v:number=Math.random()*10;
             let url:string;
             if(v<5){
@@ -202,6 +209,16 @@ export class MonsterBase extends Component {
             if(SoundManager.single.ChannelIsPlaying(this.config.id)){
                 SoundManager.single.PlaySound(this.config.id,url);
             }
+            //弹痕
+            if(this.danHen==null){
+                let socket:Node=find("RootNode/Root/CATRigHub001/transform5/CATRigSpine2/CATRigHub002",this.node);
+                let danhenNode:Node=instantiate(GameController.single.monsterZhouDanPrefab);
+                this.danHen=danhenNode.getComponent(ParticleSystemComponent);
+                socket.addChild(this.danHen.node);
+            }
+            if(this.danHen.isPlaying==false){
+                this.danHen.play();
+            }
         }
     }
 
@@ -225,6 +242,7 @@ export class MonsterBase extends Component {
         this.node.active=false;
         this.node.destroy();
         SoundManager.single.ClearSound(this.config.id);
+        this.danHen.destroy();
     }
 
     private removeAllAnimationEvent():void{