Bläddra i källkod

修改bug

修改bug
Kziwws 1 vecka sedan
förälder
incheckning
99a75f3a5b

+ 1 - 1
assets/scripts/data/SettingData.ts

@@ -50,7 +50,7 @@ class SettingData extends Singleton{
                 bgMusic: true,//背景音乐开关
                 soundFx: true,//音效开关
                 vibrate: false,//震动开关
-                sensitivity: 0.5 //相机旋转的灵敏度 值越大移动越快 灵敏度越高
+                sensitivity: 0.2 //相机旋转的灵敏度 值越大移动越快 灵敏度越高
             }
             this.saveToCache();
         }

+ 12 - 9
assets/scripts/game/Enemy.ts

@@ -100,7 +100,10 @@ export class Enemy extends BaseExp {
     //运动方向
     public moveDir: Vec3 = new Vec3();
     //设置的血量
-    public totalHP: number = 0;
+    public curHP: number = 0;
+    //敌人的原始血量
+    public originHP: number = 0;
+
     //是否是没打死逃逸
     public escape: boolean = false;
     //敌人数据
@@ -150,7 +153,7 @@ export class Enemy extends BaseExp {
         this.isDead = false;
         this.escape = false;
         //设置血量
-        this.totalHP = data.hp;
+        this.curHP = this.originHP = data.hp;
         //敌人速度
         const s: number = data.speed * 3;
         this.speed = s;
@@ -249,23 +252,23 @@ export class Enemy extends BaseExp {
         if(Game.I.isPause
             ||this.isDead
             ||hp == null
-            ||this.totalHP <= 0){
+            ||this.curHP <= 0){
             return;
         }
         this.hpBar.node.active = true;
         this.scheduleOnce(() => {
             if(this.hpBar){this.hpBar.node.active = false;}
         }, 0.8);
-        this.totalHP -= hp;
+        this.curHP -= hp;
         //这种是伤害超级高直接死亡了
-        if(hp > this.totalHP){
+        if(hp > this.originHP){
            this.escape = false;
            this.showHurt(Utils.numberToString(hp));
            this.recycle()
            return;
         }
         //敌人死亡
-        if(this.totalHP <= 0 && !this.isDead){
+        if(this.curHP <= 0 && !this.isDead){
             //爆头击杀播放音效
             if(isHeadShot){
                audioMgr.playOneShot(Constants.audios.head_shot);
@@ -273,7 +276,7 @@ export class Enemy extends BaseExp {
             this.escape = false;
             this.recycle();
         }else{//进度条和单独扣血
-            this.hpBar.progress = this.totalHP / this.data.hp; 
+            this.hpBar.progress = this.curHP / this.originHP; 
             this.showHurt(Utils.numberToString(hp));
         }
     }
@@ -326,7 +329,7 @@ export class Enemy extends BaseExp {
             return;
         };
         this.removeGun();
-        this.totalHP = 0;
+        this.curHP = 0;
         if(!this.isTank()){
            this.skeletalAnim.play(EAnimType.die);
         }
@@ -438,7 +441,7 @@ export class Enemy extends BaseExp {
         };
         const data:any = this.getDifficultyData();
         if(data.hp_ratio > 0){
-           this.totalHP = this.data.hp * (1 + data.hp_ratio);
+           this.curHP += this.originHP * data.hp_ratio;
         }
     }
    

+ 2 - 3
assets/scripts/game/GMap.ts

@@ -45,10 +45,9 @@ export class GMap extends BaseExp {
         console.log("GGGGGGG = " + pwww);*/
         //区域隐藏
         const nodes:Node[] = this.ambush_points.children.flatMap(child => child.children);
-        [this.enemy_born_area]
+        [this.enemy_born_area,this.miidle_inline,this.miidle_outline,this.doors,this.sundries]
         .concat(nodes).forEach(e => {
-            let m: MeshRenderer = e.getComponent(MeshRenderer);
-            if(m){m.enabled = false}
+            e.active = false;
         });
     }
 

+ 2 - 0
assets/scripts/game/Player.ts

@@ -256,6 +256,8 @@ export class Player extends BaseExp {
             if(this.shootUI && this.pData){
                 this.shootUI.gunDataUI();
                 this.isCutShoot = false;
+                //初始信息记录
+                this.shootUI.originalInitial();
             }   
         }
     }

+ 14 - 5
assets/scripts/ui/GunfightShootUI.ts

@@ -114,11 +114,6 @@ export class GunfightShootUI extends BaseExp {
            this.hiddeNodes.forEach(e => e.active = false);
         }
         this.wheelPos = this.wheel.position.clone();
-        //记录摄像机原始视野
-        this.originalFov = Game.I.camera.getComponent(Camera).fov;
-        //录初始旋转角度
-        this.initialPlayerRotation = Game.I.player.node.rotation.clone();
-        this.initialCameraRotation = Game.I.camera.node.rotation.clone();
         //监听当前节点触摸事件
         this.node.on(Node.EventType.TOUCH_START, this.onNodeTouchMove, this);
         this.node.on(Node.EventType.TOUCH_MOVE, this.onNodeTouchMove, this);
@@ -133,6 +128,20 @@ export class GunfightShootUI extends BaseExp {
         this.register(Constants.eventName.enemy_num_change, this.loadTaskData.bind(this));
     }
 
+    /**
+     * 摄像机初始信息
+     * @param args 
+     */
+    public originalInitial(){
+        //记录摄像机原始视野
+        this.originalFov = Game.I.camera.getComponent(Camera).fov;
+        //录初始旋转角度
+        this.initialPlayerRotation = Game.I.player.node.rotation.clone();
+        this.initialCameraRotation = Game.I.camera.node.rotation.clone();
+        this.currentYRotation = this.initialPlayerRotation.x;
+        this.currentXRotation = this.initialPlayerRotation.y; 
+    }
+
     public show(...args: any[]){
         this.loadTaskData();
     }

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

@@ -3,6 +3,6 @@
   "config": {
     "images": [],
     "sceneUUID": {},
-    "scene": "b824d4a8-95d2-4112-8d63-f7df26c184ee"
+    "scene": "2a6d10bc-9c1e-4420-ae90-e9ba997eea5f"
   }
 }