Kziwws 1 долоо хоног өмнө
parent
commit
b1bf7fe3fe

+ 36 - 63
assets/scenes/game.scene

@@ -29,7 +29,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 148
+      "__id__": 147
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -60,7 +60,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 155
+      "__id__": 154
     },
     "_id": "10795865-5525-41fc-8bf7-0e8d6983b214"
   },
@@ -298,11 +298,14 @@
         "__id__": 11
       },
       {
-        "__id__": 141
+        "__id__": 140
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
+      {
+        "__id__": 143
+      },
       {
         "__id__": 144
       },
@@ -311,9 +314,6 @@
       },
       {
         "__id__": 146
-      },
-      {
-        "__id__": 147
       }
     ],
     "_prefab": null,
@@ -453,10 +453,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 139
+        "__id__": 138
       },
       {
-        "__id__": 140
+        "__id__": 139
       }
     ],
     "_prefab": null,
@@ -504,6 +504,9 @@
     ],
     "_active": true,
     "_components": [
+      {
+        "__id__": 134
+      },
       {
         "__id__": 135
       },
@@ -512,9 +515,6 @@
       },
       {
         "__id__": 137
-      },
-      {
-        "__id__": 138
       }
     ],
     "_prefab": null,
@@ -585,9 +585,6 @@
       },
       {
         "__id__": 133
-      },
-      {
-        "__id__": 134
       }
     ],
     "_prefab": null,
@@ -2836,7 +2833,7 @@
     "_isUnderline": false,
     "_underlineHeight": 2,
     "_cacheMode": 0,
-    "_enableOutline": false,
+    "_enableOutline": true,
     "_outlineColor": {
       "__type__": "cc.Color",
       "r": 0,
@@ -3158,7 +3155,7 @@
     "_isUnderline": false,
     "_underlineHeight": 2,
     "_cacheMode": 0,
-    "_enableOutline": false,
+    "_enableOutline": true,
     "_outlineColor": {
       "__type__": "cc.Color",
       "r": 0,
@@ -4763,7 +4760,9 @@
     "_enabled": true,
     "__prefab": null,
     "_alignFlags": 40,
-    "_target": null,
+    "_target": {
+      "__id__": 13
+    },
     "_left": 0,
     "_right": 0,
     "_top": 0,
@@ -4778,7 +4777,7 @@
     "_isAbsVerticalCenter": true,
     "_originalWidth": 634,
     "_originalHeight": 0,
-    "_alignMode": 2,
+    "_alignMode": 1,
     "_lockFlags": 0,
     "_id": "50aZcYPKhBBJi7Zmmr8gyz"
   },
@@ -5085,29 +5084,6 @@
     "_atlas": null,
     "_id": "d5ST6NQDpB47EtZUZRavy1"
   },
-  {
-    "__type__": "cc.Animation",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 13
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "playOnLoad": false,
-    "_clips": [
-      {
-        "__uuid__": "333cf797-a17c-4709-8b64-36747671fe7b",
-        "__expectedType__": "cc.AnimationClip"
-      }
-    ],
-    "_defaultClip": {
-      "__uuid__": "333cf797-a17c-4709-8b64-36747671fe7b",
-      "__expectedType__": "cc.AnimationClip"
-    },
-    "_id": "1aQPFWAy9Af4eOtR6WOyUZ"
-  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
@@ -5182,9 +5158,6 @@
     },
     "_enabled": true,
     "__prefab": null,
-    "enterAnim": {
-      "__id__": 134
-    },
     "animPosArr": [
       {
         "__id__": 52
@@ -5262,10 +5235,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 142
+        "__id__": 141
       },
       {
-        "__id__": 143
+        "__id__": 142
       }
     ],
     "_prefab": null,
@@ -5304,7 +5277,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 141
+      "__id__": 140
     },
     "_enabled": true,
     "__prefab": null,
@@ -5326,7 +5299,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 141
+      "__id__": 140
     },
     "_enabled": true,
     "__prefab": null,
@@ -5438,10 +5411,10 @@
     "instance": null,
     "targetOverrides": [
       {
-        "__id__": 149
+        "__id__": 148
       },
       {
-        "__id__": 152
+        "__id__": 151
       }
     ]
   },
@@ -5451,7 +5424,7 @@
       "__id__": 12
     },
     "sourceInfo": {
-      "__id__": 150
+      "__id__": 149
     },
     "propertyPath": [
       "_target"
@@ -5460,7 +5433,7 @@
       "__id__": 12
     },
     "targetInfo": {
-      "__id__": 151
+      "__id__": 150
     }
   },
   {
@@ -5481,7 +5454,7 @@
       "__id__": 12
     },
     "sourceInfo": {
-      "__id__": 153
+      "__id__": 152
     },
     "propertyPath": [
       "_target"
@@ -5490,7 +5463,7 @@
       "__id__": 12
     },
     "targetInfo": {
-      "__id__": 154
+      "__id__": 153
     }
   },
   {
@@ -5508,28 +5481,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 156
+      "__id__": 155
     },
     "shadows": {
-      "__id__": 157
+      "__id__": 156
     },
     "_skybox": {
-      "__id__": 158
+      "__id__": 157
     },
     "fog": {
-      "__id__": 159
+      "__id__": 158
     },
     "octree": {
-      "__id__": 160
+      "__id__": 159
     },
     "skin": {
-      "__id__": 161
+      "__id__": 160
     },
     "lightProbeInfo": {
-      "__id__": 162
+      "__id__": 161
     },
     "postSettings": {
-      "__id__": 163
+      "__id__": 162
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false

+ 2 - 2
assets/scripts/game/Game.ts

@@ -8,10 +8,9 @@ import { userIns } from '../data/UserData';
 import { BuildEnemys } from './BuildEnemys';
 import { autoBind } from '../extend/AutoBind';
 import { BaseExp } from '../core/base/BaseExp';
-import { PoolManager } from '../core/manager/PoolManager';
 import { uiMgr } from '../core/manager/UIManager';
 import { Constants } from '../data/Constants';
-import { Main } from './Main';
+import { audioMgr } from '../core/manager/AudioManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('Game')
@@ -49,6 +48,7 @@ export class Game extends BaseExp {
         this.map_pos.active = true;
         //加载map
         this.loadMap();
+        audioMgr.play(Constants.audios.BGM);
     }
 
     /**

+ 1 - 1
assets/scripts/game/Launch.ts

@@ -21,7 +21,7 @@ export class Launch extends BaseExp {
         this.load_label.string = i18n("main.加载中...");
         //关闭FPS展示
         profiler.hideStats()
-        //Constants.isDebug ? profiler.showStats() : profiler.hideStats();
+        Constants.isDebug ? profiler.showStats() : profiler.hideStats();
         //先加载配置资源包 更新进度条
         await bundleMgr.preloadConfigAllRes((progress) => {
             this.progressBar.progress = progress.totalProgress;

+ 30 - 7
assets/scripts/game/Main.ts

@@ -1,4 +1,4 @@
-import { _decorator, EventTouch, Node, Label,Animation, Vec3, EditBox} from 'cc';
+import { _decorator, EventTouch, Node, Label,Animation, Vec3, EditBox, Tween, tween, easing} from 'cc';
 import List from '../third/List';
 import { Utils } from '../utils/Utils';
 import MsgHints from '../utils/MsgHints';
@@ -27,9 +27,7 @@ export class Main extends BaseExp {
     public level_lable: Label;
     @autoBind({ type: List, tooltip: "任务数据" })
     public task_scrollView: List;
-    @property({ type: Animation, tooltip: "进入游戏动画" })
-    public enterAnim: Animation;
-    @property({ type: [Node], tooltip: "动画位置节点数组" })
+    @property({ type: [Node], tooltip: "武器按钮、飞镖按钮、任务列表界面 动画位置节点数组" })
     public animPosArr: Array<Node> = [];
 
     //所有主要页面
@@ -54,8 +52,6 @@ export class Main extends BaseExp {
     start() {
         this.hasAnim = false;
         this.closeOnBlank = false;
-        //存储初始位置到类属性
-        this.originalPositions = this.animPosArr.map(e => e.position.clone());
         uiMgr.panels.set(Constants.mainUIs.main, this.node);
         //注册动态变化值
         stateMgr.registerUI(Constants.gold, this.gold_lable);
@@ -69,6 +65,33 @@ export class Main extends BaseExp {
         }
     }
 
+    /**
+     * 激活时的位置信息
+     */
+    protected onEnable(): void {
+        //存储初始位置到类属性
+        this.originalPositions = this.animPosArr.map(e => e.position.clone());
+    }
+
+    /**
+     * 进入的时候的动画
+     */
+    public enterAnim(){
+        const task_view_pos: Vec3 = this.originalPositions[0];
+        const arsenal_btn_pos: Vec3 = this.originalPositions[1];
+        const boomerang_btn_pos: Vec3 = this.originalPositions[2];
+        let posArr:Vec3[] = [
+            new Vec3(task_view_pos.x,task_view_pos.y + 622,task_view_pos.z),
+            new Vec3(arsenal_btn_pos.x - 148,arsenal_btn_pos.y,arsenal_btn_pos.z),
+            new Vec3(boomerang_btn_pos.x + 148,boomerang_btn_pos.y,boomerang_btn_pos.z)
+        ];
+       this.animPosArr.forEach((e: Node,i: number) => {
+            tween(e)
+            .to(0.7, { position: posArr[i]}, { easing: easing.backOut})
+            .start();
+        });
+    }
+
     /**
      * 加载数据
      */
@@ -112,7 +135,7 @@ export class Main extends BaseExp {
            userIns.data.level = parseInt(this.editBox.string);
         }
         this.isLoad = true;
-        this.enterAnim.play();
+        this.enterAnim();
         this.scheduleOnce(() => {
             //加载敌人
             Game.I.buildEnemys.loadLevelEnemys();

+ 10 - 3
assets/scripts/ui/ArsenalUI.ts

@@ -35,7 +35,7 @@ export class ArsenalUI extends BaseExp {
     //每个类型下的枪的数据
     private gunList:Array<any> = [];
     //玩家选择的类型 默认用户使用的枪的所在的类型
-    private curTypeData:any = null;
+    public curTypeData:any = null;
     //用户当前选择的枪 默认用户当前使用的枪
     private curGunData:any = null;
 
@@ -54,11 +54,18 @@ export class ArsenalUI extends BaseExp {
         this.model_camera.active = false;
     }
 
+    /**
+     * 强制刷新列表数据
+     */
+    public forceRefresh(){
+        this.loadArsenalData(this.curTypeData,true)
+    }
+
     /**
      * 加载武器库数据 选中的类型数据
      * @param typeData 选择的类型 默认用户选中的第一把枪的类型
      */
-    public loadArsenalData(typeData:any = null){
+    public loadArsenalData(typeData:any = null,force: boolean = false){
         //列表2、枪的类型列表、查询玩家拥有的枪的类型 按type分组 从每个分组中取出第一个元素
         const groupedByType = userIns.playerGunsTable.reduce((acc: Record<number, any[]>, gun) => {
             if (!acc[gun.type]) {
@@ -67,7 +74,7 @@ export class ArsenalUI extends BaseExp {
             acc[gun.type].push(gun);
             return acc;
         }, {});
-        if(this.gunTypeList.length <= 0){
+        if(this.gunTypeList.length <= 0 || force){
             this.gunTypeList = Object.values(groupedByType).map(group => {
                 const typeData = group[0];
                 //判断该类型是否解锁(用户是否拥有该类型的枪)

+ 4 - 3
assets/scripts/ui/GunfightShootUI.ts

@@ -59,7 +59,7 @@ export class GunfightShootUI extends BaseExp {
     /** 左右旋转角度的最大限制值 */
     private maxHorizontalAngle: number = 70;
     /** 上下旋转角度的最大限制值 */
-    private maxVerticalAngle: number = 40;
+    private maxVerticalAngle: number = 70;
     /** 相机的原始视野值 */
     private originalFov: number;
     /** 玩家节点的初始旋转四元数 */
@@ -276,9 +276,10 @@ export class GunfightShootUI extends BaseExp {
      */
     private onNodeTouchMove(event: EventTouch) {
         const delta = event.getDelta();
+        let f: number = this._isScopeOpen ? 0.2 : 0.6;
         //计算旋转角度 相机旋转的灵敏度 值越大移动越快 灵敏度越高
-        this.currentYRotation -= delta.x * settingData.data.sensitivity;
-        this.currentXRotation -= delta.y * settingData.data.sensitivity; 
+        this.currentYRotation -= delta.x * settingData.data.sensitivity * f;
+        this.currentXRotation -= delta.y * settingData.data.sensitivity * f; 
         //分别限制左右和上下旋转角度
         this.currentYRotation = clamp(this.currentYRotation, -this.maxHorizontalAngle, this.maxHorizontalAngle);
         this.currentXRotation = clamp(this.currentXRotation, -this.maxVerticalAngle, this.maxVerticalAngle);

+ 2 - 1
assets/scripts/ui/SettingUI.ts

@@ -63,7 +63,8 @@ export class SettingUI extends BaseExp {
      */
     public onSliderChanged(event: EventTouch, customEventData: string) {
         let value = this.slider.progress;
-        settingData.data.sensitivity = parseFloat(value.toFixed(1));
+        let sensitivity:number = Math.max(0.05,parseFloat(value.toFixed(1)));
+        settingData.data.sensitivity = sensitivity;
         this.setSlider();
     }
 

+ 2 - 0
assets/scripts/ui/UpgradeGunUI.ts

@@ -131,6 +131,8 @@ export class UpgradeGunUI extends BaseExp {
                 userIns.upgradeGun(this.curGunData,data.attr_name);
                 //刷新数据
                 this.loadUpgradeData(this.curGunData.id);
+                //刷新另外武器库的数据
+                uiMgr.getPageComponent(Constants.popUIs.arsenalUI)?.forceRefresh();
                 audioMgr.playOneShot(Constants.audios.upgrade);
             }
         }

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

@@ -3,6 +3,6 @@
   "config": {
     "images": [],
     "sceneUUID": {},
-    "scene": "4844b5ae-cfad-4282-92e9-d58dae3b6445"
+    "scene": "10795865-5525-41fc-8bf7-0e8d6983b214"
   }
 }