Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs issue at: 快速上手:制作第一个 3D 游戏 #2926

Closed
IAmIWi11 opened this issue May 27, 2024 · 1 comment
Closed

docs issue at: 快速上手:制作第一个 3D 游戏 #2926

IAmIWi11 opened this issue May 27, 2024 · 1 comment

Comments

@IAmIWi11
Copy link

filePath: zh/getting-started/first-game/index.md
content:

///PlayerController
reset() { 
      //只有这一行在结束时无法正确重置游戏
      this._curMoveIndex = 0;
      //新增代码使Player复原
      this._curPos = new Vec3(0, 0, 0);
      this._targetPos = new Vec3(0, 0, 0);
      this.node.getPosition(this._curPos);
}
@MrKylinGithub
Copy link
Contributor

已修复。
应该尽量避免不必要的 new 操作。 所以改成了下面这样:

 this.node.getPosition(this._curPos);
 this._targetPos.set(0,0,0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants