关键词:Godot,4.2.2,字符串应用,&,string reference
在查看Godot官方的2d项目“dodge_the_creeps”时(下图1的项目),发现其代码里使用到了&(下图2和3)



经查阅,该符号& 为字符串引用,它的含义如下:

那【AnimatedSprite2D.animation = &“right”】和【AnimatedSprite2D.animation = “right”】有什么区别吗?

最后在说说字符串引用的缺点:

总结:在大型项目中使用可提升性能;而中小型项目不推荐使用,因为会降低可读性。