如何解决在 Bevy 中派生捆绑包时如何扩展嵌套捆绑包?
在 this example 中,提供了以下代码。
#[derive(Bundle)]
struct PlayerBundle {
xp: PlayerXp,name: PlayerName,health: Health,_p: Player,// We can nest/include another bundle.
// Add the components for a standard Bevy Sprite:
#[bundle]
sprite: SpriteSheetBundle,}
然而,#[bundle] 标签似乎在最新版本中丢失了。有没有办法在 0.4.0 中提供类似的功能?我知道我可以使用“commands.with”和“commands.with_bundle”,但我没有看到“spawn_batch”的替代方案,而无需手动扁平化结构以组合包。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。