jakobhellermann / bevy-inspector-egui

Inspector plugin for the bevy game engine
Apache License 2.0
1.12k stars 166 forks source link

WorldInspectorPlugin example in readme does not compile in bevy 0.10 #127

Closed kALLEBALIK closed 1 year ago

kALLEBALIK commented 1 year ago

Current example code:

use bevy::prelude::*;
use bevy_inspector_egui::quick::WorldInspectorPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(WorldInspectorPlugin)
        .run();
}

error:

error[E0423]: expected value, found struct `WorldInspectorPlugin`
  --> src\main.rs:7:21
   |
7  |         .add_plugin(WorldInspectorPlugin)
   |                     ^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `WorldInspectorPlugin { condition: val }`

Solution:

Use WorldInspectorPlugin default constructor.

use bevy::prelude::*;
use bevy_inspector_egui::quick::WorldInspectorPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(WorldInspectorPlugin::default())
        .run();
}
jakobhellermann commented 1 year ago

fixed, thanks for reporting