我想让相机移动到特定的偏移量.使用"HorizontalCamera.setScroll(800,0)"方法,它会立即移动.我怎么才能让它随着动画一起移动呢? 附言:我正在使用相位器编辑器2d
class GoNext extends UserComponent {
constructor(gameObject) {
super(gameObject);
this.gameObject = gameObject;
gameObject["__GoNext"] = this;
/* START-USER-CTR-CODE */
// Write your code here.
/* END-USER-CTR-CODE */
}
/** @returns {GoNext} */
static getComponent(gameObject) {
return gameObject["__GoNext"];
}
/** @type {Phaser.GameObjects.Text} */
gameObject;
/* START-USER-CODE */
awake() {
let horizontalCamera
this.gameObject.setInteractive().on("pointerdown", () => {
horizontalCamera = this.scene.cameras.add(0, 0, 800, 600)
horizontalCamera.setScroll(800, 0)
});
}
// Write your code here.
/* END-USER-CODE */
}