在 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 (将#修改为@)