Kziwws 1 周之前
父節點
當前提交
dc311b8641
共有 4 個文件被更改,包括 289 次插入143 次删除
  1. 275 136
      assets/prefabs/ui/settleUI.prefab
  2. 0 4
      assets/scripts/ui/ObtainUI.ts
  3. 13 2
      assets/scripts/ui/SettleUI.ts
  4. 1 1
      profiles/v2/packages/reference-image.json

文件差異過大導致無法顯示
+ 275 - 136
assets/prefabs/ui/settleUI.prefab


+ 0 - 4
assets/scripts/ui/ObtainUI.ts

@@ -1,12 +1,8 @@
 import { _decorator, Node, Label, Sprite, EventTouch, Tween, tween, Vec3} from 'cc';
 import { BaseExp } from '../core/base/BaseExp';
-import List from '../third/List';
 import { autoBind } from '../extend/AutoBind';
 import { userIns } from '../data/UserData';
-import MsgHints from '../utils/MsgHints';
 import { Constants } from '../data/Constants';
-import { stateMgr } from '../core/manager/StateManager';
-import { UpgradeItem } from '../items/item/UpgradeItem';
 import { uiMgr } from '../core/manager/UIManager';
 import { ResUtil } from '../utils/ResUtil';
 import i18n from '../core/i18n/runtime-scripts/LanguageData';

+ 13 - 2
assets/scripts/ui/SettleUI.ts

@@ -1,4 +1,4 @@
-import { _decorator, Node, Label, Sprite, EventTouch, SpriteFrame} from 'cc';
+import { _decorator, Node, Label, Sprite, EventTouch, SpriteFrame, Tween, tween, Vec3} from 'cc';
 import { BaseExp } from '../core/base/BaseExp';
 import { autoBind } from '../extend/AutoBind';
 import { userIns } from '../data/UserData';
@@ -33,6 +33,8 @@ export class SettleUI extends BaseExp {
     public gun_not_unlock_icon: Sprite;
     @autoBind({ type: Sprite, tooltip: "未解锁的枪的图片" })
     public gun_unlock_icon: Sprite;
+    @autoBind({ type: Node, tooltip: "旋转光节点" })
+    public rotation_light: Node;
 
     @autoBind({ type: Node, tooltip: "任务奖励按钮" })
     public task_reward_btn: Node;
@@ -72,6 +74,8 @@ export class SettleUI extends BaseExp {
     }
     
     public show(...args: any[]){
+        Tween.stopAllByTarget(this.rotation_light);
+        this.rotation_light.active = false;
         this.hasAnim = true;
         this.param = args[0];
         //加载数据ui
@@ -100,7 +104,14 @@ export class SettleUI extends BaseExp {
                 let gunData:any = userIns.playerGunsTable.find(e=>e.id == gun_id);
                 ResUtil.setSpriteFrame(gunData.gun_unlock_icon,this.gun_unlock_icon);
                 ResUtil.setSpriteFrame(gunData.gun_not_unlock_icon,this.gun_not_unlock_icon);
-                if(cur == max){//解锁该武器
+                //解锁该武器
+                if(cur == max && !Utils.isNull(gun_id)){
+                    this.rotation_light.active = true;
+                    userIns.unlockGun(gun_id);
+                    tween(this.rotation_light)
+                        .by(2, { eulerAngles: new Vec3(0, 0, -360) })
+                        .repeatForever()
+                        .start();
                 }
                 //解锁进度
                 this.progress_num_lable.string =`${cur}/${max}`;

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

@@ -3,6 +3,6 @@
   "config": {
     "images": [],
     "sceneUUID": {},
-    "scene": "6fdfa45a-54d2-427e-9510-d0cbbbc63997"
+    "scene": "ea775253-49d0-4ed3-b61d-b95637b22a14"
   }
 }

部分文件因文件數量過多而無法顯示