mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-09 00:38:00 +08:00
fix: 读档视角
This commit is contained in:
parent
f09704f7da
commit
f03eae4345
@ -39,8 +39,6 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
private delegation: number = -1;
|
private delegation: number = -1;
|
||||||
/** 渐变委托ticker */
|
/** 渐变委托ticker */
|
||||||
private transition: number = -1;
|
private transition: number = -1;
|
||||||
/** 移动的委托ticker */
|
|
||||||
private moveDelegation: number = -1;
|
|
||||||
/** 移动委托ticker */
|
/** 移动委托ticker */
|
||||||
private moving: number = -1;
|
private moving: number = -1;
|
||||||
/** 是否在渐变过程中 */
|
/** 是否在渐变过程中 */
|
||||||
@ -82,6 +80,9 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
setAutoBound(boundX: boolean = this.boundX, boundY: boolean = this.boundY) {
|
setAutoBound(boundX: boolean = this.boundX, boundY: boolean = this.boundY) {
|
||||||
this.boundX = boundX;
|
this.boundX = boundX;
|
||||||
this.boundY = boundY;
|
this.boundY = boundY;
|
||||||
|
this.group.requestBeforeFrame(() => {
|
||||||
|
this.setPosition(this.nx, this.ny);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,6 +117,7 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
this.group.removeTicker(this.transition, false);
|
this.group.removeTicker(this.transition, false);
|
||||||
this.nx = nx;
|
this.nx = nx;
|
||||||
this.ny = ny;
|
this.ny = ny;
|
||||||
|
console.log(nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -197,7 +199,7 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
|
|
||||||
if (ending) {
|
if (ending) {
|
||||||
if (this.ox === xTarget && this.oy == yTarget) {
|
if (this.ox === xTarget && this.oy == yTarget) {
|
||||||
this.group.removeTicker(this.moveDelegation);
|
this.hero.off('moveTick', this.movingFramer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,7 +298,6 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
const ry = by * cell - halfHeight + half;
|
const ry = by * cell - halfHeight + half;
|
||||||
core.bigmap.offsetX = rx;
|
core.bigmap.offsetX = rx;
|
||||||
core.bigmap.offsetY = ry;
|
core.bigmap.offsetY = ry;
|
||||||
|
|
||||||
this.group.camera.setTranslate(-rx, -ry);
|
this.group.camera.setTranslate(-rx, -ry);
|
||||||
this.group.update(this.group);
|
this.group.update(this.group);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user