Compare commits
2 Commits
cc06adeda1
...
70130cb930
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70130cb930 | ||
|
|
7047ba932e |
File diff suppressed because it is too large
Load Diff
@@ -575,17 +575,29 @@ export class CardComp extends CCComp {
|
|||||||
this.isDragging = false;
|
this.isDragging = false;
|
||||||
|
|
||||||
if (deltaY >= this.dragUseThreshold) {
|
if (deltaY >= this.dragUseThreshold) {
|
||||||
this.useCard();
|
const used = this.useCard();
|
||||||
// 使用卡牌后恢复非放大状态
|
if (!used) {
|
||||||
this.isEnlarged = false;
|
// 使用失败(如金币不足),恢复未放大状态并回弹
|
||||||
this.isLongPressed = false;
|
this.isEnlarged = false;
|
||||||
|
this.isLongPressed = false;
|
||||||
|
const currentPos = this.node.position.clone();
|
||||||
|
this.applyCardUI();
|
||||||
|
this.node.setPosition(currentPos);
|
||||||
|
this.playReboundAnim();
|
||||||
|
} else {
|
||||||
|
// 使用成功,恢复非放大状态
|
||||||
|
this.isEnlarged = false;
|
||||||
|
this.isLongPressed = false;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 无论是点击还是长按松手,都恢复正常大小
|
// 无论是点击还是长按松手,都恢复正常大小
|
||||||
if (this.isEnlarged) {
|
if (this.isEnlarged) {
|
||||||
this.isEnlarged = false;
|
this.isEnlarged = false;
|
||||||
|
const currentPos = this.node.position.clone();
|
||||||
this.applyCardUI();
|
this.applyCardUI();
|
||||||
|
this.node.setPosition(currentPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isLongPressed = false;
|
this.isLongPressed = false;
|
||||||
@@ -600,7 +612,9 @@ export class CardComp extends CCComp {
|
|||||||
|
|
||||||
if (this.isEnlarged) {
|
if (this.isEnlarged) {
|
||||||
this.isEnlarged = false;
|
this.isEnlarged = false;
|
||||||
|
const currentPos = this.node.position.clone();
|
||||||
this.applyCardUI();
|
this.applyCardUI();
|
||||||
|
this.node.setPosition(currentPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isLongPressed = false;
|
this.isLongPressed = false;
|
||||||
|
|||||||
@@ -811,7 +811,7 @@ export class MissionCardComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateCoinAndCostUI() {
|
private updateCoinAndCostUI() {
|
||||||
this.updatePoolLvUI();
|
// this.updatePoolLvUI();
|
||||||
this.updateDrawCostUI();
|
this.updateDrawCostUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user