用户:
SCS_user_NeafwWelae查看:0 回复:1 评论:0 创建时间:2024-02-01T16:57:17
如题
const d = entity.player.facingDirection
定义常量d后 当玩家转向后 引用常量d是玩家当前的方向 而不是定义时的
怎么解决?
代码换成:
const d = entity.player.facingDirection.clone();
不是很懂指针......
你问题的原因似乎是d和entity.player.facingDirection是同一个地址,entity.player.facingDirection变化d也会变化?
点赞0
评论