perf: 优化奖励特效
This commit is contained in:
@@ -242,6 +242,13 @@ export class PlayerController extends Component {
|
||||
// 开始沿路径移动
|
||||
this.currentPathIndex = 0;
|
||||
this.isMoving = true;
|
||||
|
||||
// 根据移动方向选择动画
|
||||
const animationName = this.getAnimationNameByDirection(startPos, clampedPos);
|
||||
|
||||
// 切换到对应的动画
|
||||
this.switchAnimation(animationName);
|
||||
|
||||
this.moveToNextWaypoint();
|
||||
}
|
||||
|
||||
@@ -355,11 +362,6 @@ export class PlayerController extends Component {
|
||||
const targetPos = this.currentPath[this.currentPathIndex];
|
||||
const currentPos = this.player.position;
|
||||
|
||||
// 根据移动方向选择动画
|
||||
const animationName = this.getAnimationNameByDirection(currentPos, targetPos);
|
||||
|
||||
// 切换到对应的动画
|
||||
this.switchAnimation(animationName);
|
||||
|
||||
// 计算移动距离和时间
|
||||
const distance = Vec3.distance(currentPos, targetPos);
|
||||
|
||||
Reference in New Issue
Block a user