|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-20 15:01:09
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-25 16:44:26
|
|
|
+ * @LastEditTime: 2025-04-25 17:38:15
|
|
|
* @Description: 消除游戏主场景
|
|
|
*/
|
|
|
import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
|
|
|
@@ -369,7 +369,9 @@ export class EliminateViewComp extends CCComp {
|
|
|
|
|
|
//开始自动游戏
|
|
|
startAutoGame() {
|
|
|
- this.autoGame();
|
|
|
+ if (!this.autoState) {
|
|
|
+ this.autoGame();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1047,7 +1049,25 @@ export class EliminateViewComp extends CCComp {
|
|
|
if (index > -1) {
|
|
|
this.editingData.brickData = this.bricksList.splice(index, 1)[0];
|
|
|
} else {
|
|
|
- console.error("未找到方块数据:", brickData);
|
|
|
+ //返回原位置
|
|
|
+ console.error(">>this.bricksList>>>>>>", JSON.stringify(this.bricksList));
|
|
|
+ console.error("未找到方块数据:", JSON.stringify(brickData));
|
|
|
+ this.bricksList.push(brickData)
|
|
|
+ if (brickData.brickNode) {
|
|
|
+ tween(brickData.brickNode)
|
|
|
+ .to(0.15, {
|
|
|
+ worldPosition: brickData.brickInitPos,
|
|
|
+ scale: new Vec3(0.8, 0.8, 0.8)
|
|
|
+ })
|
|
|
+ .call(() => {
|
|
|
+ if (brickData.brickNode) {
|
|
|
+ this.operateFlag = true
|
|
|
+ this.brickNode.addChild(brickData.brickNode)
|
|
|
+ brickData.brickNode.setWorldPosition(brickData.brickInitPos)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .start()
|
|
|
+ }
|
|
|
}
|
|
|
}, this);
|
|
|
|