|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-11 18:05:45
|
|
* @Date: 2025-03-11 18:05:45
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-03-18 10:13:28
|
|
|
|
|
|
|
+ * @LastEditTime: 2025-03-18 14:39:01
|
|
|
* @Description:
|
|
* @Description:
|
|
|
*/
|
|
*/
|
|
|
import { _decorator, Color, EventTouch, instantiate, JsonAsset, Node, Prefab, Sprite, UITransform, Vec3, Widget, tween } from "cc";
|
|
import { _decorator, Color, EventTouch, instantiate, JsonAsset, Node, Prefab, Sprite, UITransform, Vec3, Widget, tween } from "cc";
|
|
@@ -77,9 +77,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
@property({ type: Prefab, displayName: "红包预制体" })
|
|
@property({ type: Prefab, displayName: "红包预制体" })
|
|
|
private redPacketPrefab: Prefab = null!;
|
|
private redPacketPrefab: Prefab = null!;
|
|
|
|
|
|
|
|
- @property({ type: Prefab, displayName: "锤子预制体" })
|
|
|
|
|
- private hammerPrefab: Prefab = null!;
|
|
|
|
|
-
|
|
|
|
|
//游戏状态
|
|
//游戏状态
|
|
|
game_status: number = GameStatus.None;
|
|
game_status: number = GameStatus.None;
|
|
|
max_row: number = 0;
|
|
max_row: number = 0;
|
|
@@ -575,7 +572,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
console.log("打印进这里来了")
|
|
console.log("打印进这里来了")
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- //这个事件不生效
|
|
|
|
|
brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
|
|
brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
|
|
|
// if (this.adShowingFlag) return
|
|
// if (this.adShowingFlag) return
|
|
|
// 未操作完时不能操作下一个方块
|
|
// 未操作完时不能操作下一个方块
|
|
@@ -647,7 +643,9 @@ export class EliminateViewComp extends CCComp {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (gridData === null) return
|
|
|
|
|
|
|
+ if (gridData === null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
tempGridList.push(gridData)
|
|
tempGridList.push(gridData)
|
|
|
})
|
|
})
|
|
|
// 检查整体情况
|
|
// 检查整体情况
|
|
@@ -663,8 +661,9 @@ export class EliminateViewComp extends CCComp {
|
|
|
}
|
|
}
|
|
|
// 格子给用户提示
|
|
// 格子给用户提示
|
|
|
tempGridList.forEach((gridData) => {
|
|
tempGridList.forEach((gridData) => {
|
|
|
- if (gridData.status !== GridStatus.NotUse) return
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (gridData.status !== GridStatus.NotUse) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (gridData.gridNode) {
|
|
if (gridData.gridNode) {
|
|
|
const children = gridData.gridNode.children[0];
|
|
const children = gridData.gridNode.children[0];
|
|
|
if (children) {
|
|
if (children) {
|
|
@@ -675,7 +674,8 @@ export class EliminateViewComp extends CCComp {
|
|
|
this.gridColorList.push(gridData)
|
|
this.gridColorList.push(gridData)
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
- // 触摸松开后,这里有问题,到位置,提示格子是绿色,能放置,但是不动了,正常应该能过去并且放置到格子的
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 触摸结束
|
|
|
brickNode.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
|
|
brickNode.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
|
|
|
console.log("移动结束数据查看", this.editingData.gridList.length);
|
|
console.log("移动结束数据查看", this.editingData.gridList.length);
|
|
|
console.log("brickData数据查看", this.editingData.brickData);
|
|
console.log("brickData数据查看", this.editingData.brickData);
|
|
@@ -1437,7 +1437,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
bestRotation = { gridConfig: currentGridConfig, deg: currentDeg }
|
|
bestRotation = { gridConfig: currentGridConfig, deg: currentDeg }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 如果方块可以旋转,计算下一个旋转状态
|
|
// 如果方块可以旋转,计算下一个旋转状态
|
|
|
if (brickData.rotateFlag && rotation < 3) {
|
|
if (brickData.rotateFlag && rotation < 3) {
|
|
|
const next = this.nextGridRotate(currentGridConfig, currentDeg)
|
|
const next = this.nextGridRotate(currentGridConfig, currentDeg)
|