File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ impl Plugin for SpritePlugin {
110
110
#[ cfg( feature = "bevy_sprite_picking_backend" ) ]
111
111
app. add_plugins ( SpritePickingPlugin ) ;
112
112
113
+ // We intentionally aren't unwrapping the render app since this plugin may be added in
114
+ // headless situations (e.g., to spawn a scene that includes a Sprite).
113
115
if let Some ( render_app) = app. get_sub_app_mut ( RenderApp ) {
114
116
render_app
115
117
. init_resource :: < ImageBindGroups > ( )
@@ -142,6 +144,7 @@ impl Plugin for SpritePlugin {
142
144
}
143
145
144
146
fn finish ( & self , app : & mut App ) {
147
+ // We intentionally aren't unwrapping the render app. See `build()` for details.
145
148
if let Some ( render_app) = app. get_sub_app_mut ( RenderApp ) {
146
149
render_app
147
150
. init_resource :: < SpriteBatches > ( )
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ impl Plugin for Mesh2dRenderPlugin {
68
68
69
69
embedded_asset ! ( app, "mesh2d.wgsl" ) ;
70
70
71
+ // We intentionally aren't unwrapping the render app since this plugin is added
72
+ // unconditionally by `SpritePlugin`, which may itself be added in headless situations.
71
73
if let Some ( render_app) = app. get_sub_app_mut ( RenderApp ) {
72
74
render_app
73
75
. init_resource :: < ViewKeyCache > ( )
You can’t perform that action at this time.
0 commit comments