新增Sprite用于控制纹理

This commit is contained in:
yhh
2020-06-19 18:16:42 +08:00
parent 981e149ca5
commit d22c5775c2
18 changed files with 348 additions and 191 deletions

View File

@@ -22,8 +22,7 @@ class PlayerController extends Component {
if (this.down){
let camera = SceneManager.getActiveScene().camera;
let worldVec = camera.screenToWorldPoint(this.touchPoint);
this.entity.position = Vector2.lerp(this.entity.position, Vector2.add(worldVec,
new Vector2(this.entity.scene.stage.stageWidth / 2, this.entity.scene.stage.stageHeight / 2)), Time.deltaTime);
this.entity.position = Vector2.lerp(this.entity.position, worldVec, Time.deltaTime);
}
}
}