:warning: This is very much work in progress: Take a look at the missing features to see if your use case isn't yet supported.
Adds debug tools to your bevy game, including
This is not, and isn't meant to be, comparable to the actual editor bevy will end up with. bevy_editor_pls
attempts to get the low hanging fruits by adding editor UI to the game executable, without having all the complexity that comes with having a proper well-designed editor architecture.
Add the EditorPlugin
:
```diff +use bevyeditorpls::prelude::*;
fn main() { App::new() .addplugins(DefaultPlugins) + .addplugin(EditorPlugin) ... .run(); } ```
```rust use bevyeditorpls::{egui, prelude::*}; use bevyeditorplscore::editorwindow::{EditorWindow, EditorWindowContext};
fn main() {
App::new()
...
.addeditorwindow::
pub struct MyEditorWindow; struct MyEditorWindowState { } impl EditorWindow for MyEditorWindow { type State = MyEditorWindowState; const NAME: &'static str = "Another editor panel";
fn ui(world: &mut World, cx: EditorWindowContext, ui: &mut egui::Ui) {
let currently_inspected = &cx.state::<MyEditorWindow>().unwrap().selected;
ui.label("Anything can go here");
}
} ```
The default controls are:
E
to toggle the editorCtrl+Enter
to pause/unpause timeClick
(or Ctrl+Click
when not in editor) to select meshClick + Drag
for the pan/zoom 2d cameraCameras:
2d (Pan/Zoom)
: any mouse button to pan, scroll to zoom3d (Free)
: WASD + Ctrl/Shift
+ Shift
for a speed boost for the free 3d camera3d (Pan/Orbit)
: Right click
to rotate around focus, Middle mouse button
to panChanging the default controls
```rust use bevyeditorpls::EditorPlugin; use bevyeditorpls::controls; use bevyeditorplsdefaultwindows::hierarchy::picking::EditorRayCastSource;
fn main() { App::new() // .. .addplugin(EditorPlugin) .insertresource(editorcontrols()) .addstartupsystem(setcam3d_controls) // .. .run(); }
fn editorcontrols() -> EditorControls { let mut editorcontrols = EditorControls::defaultbindings(); editorcontrols.unbind(controls::Action::PlayPauseEditor);
editor_controls.insert(
controls::Action::PlayPauseEditor,
controls::Binding {
input: controls::UserInput::Single(controls::Button::Keyboard(KeyCode::Escape)),
conditions: vec![controls::BindingCondition::ListeningForText(false)],
},
);
editor_controls
}
fn setcam3dcontrols( mut query: Query<&mut bevyeditorpls::defaultwindows::cameras::camera3dfree::FlycamControls>, ) { let mut controls = query.singlemut(); controls.keyup = KeyCode::Q; controls.keydown = KeyCode::E; } ```
| bevy | bevyeditorpls | | ---- | --------------- | | 0.10 | 0.3 | | 0.9 | 0.2 | | 0.8 | 0.1 |