|
@@ -99,7 +99,7 @@ export default class UEGridMap extends UEBase {
|
|
|
}, idx)
|
|
|
}
|
|
|
cell.Init({
|
|
|
- zIndex: idx,
|
|
|
+ idx: idx,
|
|
|
ueCube: cube,
|
|
|
unlock: cellData.unlock
|
|
|
});
|
|
@@ -125,7 +125,7 @@ export default class UEGridMap extends UEBase {
|
|
|
mergeCube.Init({
|
|
|
type: geziData.type,
|
|
|
id: geziData.correlationId,
|
|
|
- zIndex: Number(key),
|
|
|
+ idx: Number(key),
|
|
|
});
|
|
|
curCell.SetCube(mergeCube);
|
|
|
}
|
|
@@ -138,7 +138,7 @@ export default class UEGridMap extends UEBase {
|
|
|
mergeCube.Init({
|
|
|
type: data.cube.type,
|
|
|
id: data.cube.correlationId,
|
|
|
- zIndex: data.cell.GetZIndex(),
|
|
|
+ idx: data.cell.GetZIndex(),
|
|
|
});
|
|
|
data.cell.SetCube(mergeCube);
|
|
|
//播放经验爆炸飞行动画
|
|
@@ -174,7 +174,8 @@ export default class UEGridMap extends UEBase {
|
|
|
const cell = this.GetCellByPos(touchPos);
|
|
|
if (cell) {
|
|
|
if (this.selectedCell) {
|
|
|
- this.selectedCell.SetSelect(false);
|
|
|
+ // this.selectedCell.SetSelect(false);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, 0);
|
|
|
}
|
|
|
if (!cell.IsEmpty() && !cell.IsLock()) {
|
|
|
if (cell.CanDrag()) {
|
|
@@ -185,7 +186,8 @@ export default class UEGridMap extends UEBase {
|
|
|
this.clickCnt = 1;
|
|
|
}
|
|
|
this.selectedCell = cell;
|
|
|
- cell.SetSelect(true);
|
|
|
+ // cell.SetSelect(true);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, cell.GetZIndex());
|
|
|
EventMng.emit(GridEvent.HC_MERGE_SELL, { isShow: true, item: cell.GetCube().GetCubeData() });
|
|
|
} else {
|
|
|
this.selectedCell = null;
|
|
@@ -207,7 +209,8 @@ export default class UEGridMap extends UEBase {
|
|
|
if (!this.isDragging && distance >= DRAG_THRESHOLD) {
|
|
|
this.isDragging = true;
|
|
|
this.selectedCell.GetCube().StartDrag();
|
|
|
- this.selectedCell.SetSelect(false);
|
|
|
+ // this.selectedCell.SetSelect(false);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, 0);
|
|
|
}
|
|
|
|
|
|
if (this.isDragging) {
|
|
@@ -218,10 +221,12 @@ export default class UEGridMap extends UEBase {
|
|
|
cube.node.setPosition(originalPos.x + deltaPos.x, originalPos.y + deltaPos.y);
|
|
|
this.dragStartPos = touchPos;
|
|
|
const targetCell = this.GetCellByPos(touchPos);
|
|
|
- this.lastMoveCell?.SetSelect(false);
|
|
|
+ // this.lastMoveCell?.SetSelect(false);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, 0);
|
|
|
this.lastMoveCell = targetCell;
|
|
|
if (targetCell && !targetCell.IsLock()) {
|
|
|
- targetCell?.SetSelect(true);
|
|
|
+ // targetCell.SetSelect(true);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, targetCell.GetZIndex());
|
|
|
}
|
|
|
if (targetCell && targetCell != this.selectedCell) {
|
|
|
if (!targetCell.IsEmpty() && GameDataCenter.gridMap.CellCanPut(this.selectedCell, targetCell)) {
|
|
@@ -262,8 +267,9 @@ export default class UEGridMap extends UEBase {
|
|
|
if (!this.isDragging) return;
|
|
|
if (targetCell && targetCell != this.selectedCell && !targetCell.IsLock()) {
|
|
|
GameDataCenter.gridMap.TryMergeItems(this.selectedCell, targetCell);
|
|
|
- this.selectedCell.SetSelect(false);
|
|
|
- targetCell.SetSelect(true);
|
|
|
+ // this.selectedCell.SetSelect(false);
|
|
|
+ // targetCell.SetSelect(true);
|
|
|
+ EventMng.emit(GridEvent.HC_CELL_SELECT, targetCell.GetZIndex());
|
|
|
} else {
|
|
|
this.CheckSell();
|
|
|
this.selectedCell.GetCube().BackToOriginalPos(true);
|
|
@@ -308,7 +314,7 @@ export default class UEGridMap extends UEBase {
|
|
|
mergeCube.Init({
|
|
|
type: data.item.type,
|
|
|
id: data.item.correlationId,
|
|
|
- zIndex: data.idx,
|
|
|
+ idx: data.idx,
|
|
|
});
|
|
|
targetCell.SetCube(mergeCube);
|
|
|
mergeCube.SetZIndex(1000);
|