|
@@ -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}`;
|