don't panic when no RenderResourceContext can be found (#1971)

In bevy_webgl2, the `RenderResourceContext` is created after startup as it needs to first wait for an event from js side:
f31e5d49de/src/lib.rs (L117)

remove `panic` introduced in #1965 and log as a `warn` instead
This commit is contained in:
François 2021-04-20 21:44:32 +00:00
parent 80df583a21
commit 30c6ca6166

View file

@ -17,6 +17,7 @@ use bevy_ecs::{
system::{IntoExclusiveSystem, IntoSystem, Res},
};
use bevy_transform::TransformSystem;
use bevy_utils::tracing::warn;
use draw::{OutsideFrustum, Visible};
pub use once_cell;
@ -229,8 +230,8 @@ impl Plugin for RenderPlugin {
fn check_for_render_resource_context(context: Option<Res<Box<dyn RenderResourceContext>>>) {
if context.is_none() {
panic!(
warn!(
"bevy_render couldn't find a render backend. Perhaps try adding the bevy_wgpu feature/plugin!"
)
);
}
}