|
@@ -8,6 +8,9 @@ import { Tips } from "../../scripts/mgr/Tips";
|
|
|
import GameM from "../../scripts/api/GameM";
|
|
|
import ItemsM from "../../scripts/mgr/ItemsM";
|
|
|
import UserM from "../../scripts/api/UserM";
|
|
|
+import UIUtils from "../../scripts/base/UIUtils";
|
|
|
+import { Vec3 } from "cc";
|
|
|
+import { isValid } from "cc";
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
export interface POGClaimLayerCallback {
|
|
@@ -36,20 +39,12 @@ export class CritLayer extends BaseUI {
|
|
|
|
|
|
let result = await GameM.ins.getCritReward(gameId, spinId);
|
|
|
if (!result) {
|
|
|
+ this.playAnim();
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // UserM.ins.addGoods(GoodsId.POG, result.critPog);
|
|
|
-
|
|
|
- ItemsM.ins.itemChange(
|
|
|
- [
|
|
|
- {
|
|
|
- id: GoodsId.POG,
|
|
|
- count: result.critPog,
|
|
|
- },
|
|
|
- ],
|
|
|
- result.goodList
|
|
|
- );
|
|
|
+ UserM.ins.refreshGoods(result.goodList);
|
|
|
|
|
|
this.critRewardPog = result.critPog;
|
|
|
|
|
@@ -58,8 +53,56 @@ export class CritLayer extends BaseUI {
|
|
|
"lbl_crit_pog2",
|
|
|
"" + Utils.formatNumber(pogValue + result.critPog, 2)
|
|
|
);
|
|
|
+ this.playAnim();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ playAnim() {
|
|
|
+ let self=this;
|
|
|
+ this.a1.active = true;
|
|
|
+ this.a1.setPosition(0, -500, 0);
|
|
|
+ this.a2.setPosition(0, -500, 0);
|
|
|
+ this.a3.setPosition(0, -500, 0);
|
|
|
+ this.a3.setScale(0.5, 0.5, 0.5);
|
|
|
+ UIUtils.AnimBezierMoveAndScale(
|
|
|
+ this.a1,
|
|
|
+ new Vec3(0, 0, 0),
|
|
|
+ 0.7,
|
|
|
+ 0.5,
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
+ setTimeout(() => {
|
|
|
+ this.a2.active = true;
|
|
|
+ UIUtils.AnimBezierMoveAndScale(this.a2, new Vec3(0, 0, 0), 1, 1, () => {});
|
|
|
+ }, 1000);
|
|
|
+ setTimeout(() => {
|
|
|
+ if (!isValid(self.node)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.a3.active = true;
|
|
|
+ UIUtils.AnimBezierMoveAndScale(
|
|
|
+ self.a3,
|
|
|
+ new Vec3(0, 0, 0),
|
|
|
+ 1.4,
|
|
|
+ 1,
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
+ }, 1500);
|
|
|
+
|
|
|
+ }
|
|
|
+ private a1: Node;
|
|
|
+ private a2: Node;
|
|
|
+ private a3: Node;
|
|
|
+ protected onLoad(): void {
|
|
|
+ super.onLoad();
|
|
|
+ this.a1 = this.FindNode("anim1").children[0];
|
|
|
+ this.a2 = this.FindNode("anim2").children[0];
|
|
|
+ this.a3 = this.FindNode("anim3").children[0];
|
|
|
+ this.a1.active = false;
|
|
|
+ this.a2.active = false;
|
|
|
+ this.a3.active = false;
|
|
|
+ }
|
|
|
protected simpleOnBtnClick(name: string): void {
|
|
|
switch (name) {
|
|
|
case "btn_claim":
|