Skip to content

Commit

Permalink
runs but no egui shows
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniMinerX committed Jan 24, 2025
1 parent 668b2b1 commit 65d1e46
Show file tree
Hide file tree
Showing 8 changed files with 501 additions and 1,850 deletions.
2,293 changes: 471 additions & 1,822 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ anyhow = "1.0"
bevy_asset_loader = "0.22.0"
bevy_debug_grid = { git = "https://github.com/romenjelly/bevy_debug_grid.git"}
bevy_egui = "0.32.0"
bevy-inspector-egui = { git = "https://github.com/MiniMinerX/bevy-inspector-egui.git", branch = "egui30", features = [
bevy-inspector-egui = { git = "https://github.com/MiniMinerX/bevy-inspector-egui.git", branch = "space_edit", features = [
"bevy_pbr",
"highlight_changes",
] }
Expand Down
28 changes: 12 additions & 16 deletions crates/editor_ui/src/camera_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,11 @@ impl EditorTab for CameraViewTab {
self.real_camera = Some(
commands
.spawn((
Camera3dBundle {
camera: Camera {
is_active: true,
order: 2,
clear_color: bevy::render::camera::ClearColorConfig::Default,
..default()
},
Camera3d::default(),
Camera {
is_active: true,
order: 2,
clear_color: bevy::render::camera::ClearColorConfig::Default,
..default()
},
RenderLayers::layer(0),
Expand All @@ -106,13 +104,11 @@ impl EditorTab for CameraViewTab {
self.real_camera = Some(
commands
.spawn((
Camera2dBundle {
camera: Camera {
is_active: false,
order: 2,
clear_color: bevy::render::camera::ClearColorConfig::Default,
..default()
},
Camera2d::default(),
Camera {
is_active: false,
order: 2,
clear_color: bevy::render::camera::ClearColorConfig::Default,
..default()
},
RenderLayers::layer(0),
Expand Down Expand Up @@ -172,7 +168,7 @@ impl EditorTab for CameraViewTab {
Projection::Perspective(PerspectiveProjection::default()),
Name::new("Camera3d".to_string()),
Transform::default(),
VisibilityBundle::default(),
Visibility::default(),
PlaymodeCamera::default(),
PrefabMarker,
CameraRenderGraph::new(bevy::core_pipeline::core_3d::graph::Core3d),
Expand All @@ -183,7 +179,7 @@ impl EditorTab for CameraViewTab {
Camera2d {},
Name::new("Camera2d".to_string()),
Transform::default(),
VisibilityBundle::default(),
Visibility::default(),
PlaymodeCamera::default(),
CameraRenderGraph::new(bevy::core_pipeline::core_2d::graph::Core2d),
PrefabMarker,
Expand Down
11 changes: 5 additions & 6 deletions crates/editor_ui/src/menu_toolbars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,12 @@ pub fn bottom_menu(
if button.clicked() {
let entity = dyn_bundle.spawn(&mut commands);
if let Ok(pan_cam) = q_pan_cam.get_single() {
commands.entity(entity).insert(
SpatialBundle::from_transform(
Transform::from_translation(
pan_cam.focus,
),
commands.entity(entity).insert((
Transform::from_translation(
pan_cam.focus,
),
);
Visibility::default(),
));
}
changes.send(NewChange {
change: Arc::new(AddedEntity { entity }),
Expand Down
3 changes: 2 additions & 1 deletion crates/editor_ui/src/ui_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ impl Plugin for EditorUiCore {
//play systems
app.add_systems(OnEnter(EditorState::GamePrepare), save_prefab_before_play);
// clean up meshless children on entering the game state

//app.add_systems(OnEnter(EditorState::GamePrepare), clean_meshless);
app.add_systems(
OnEnter(SaveState::Idle),
Expand All @@ -186,7 +187,7 @@ impl Plugin for EditorUiCore {
//draw_light_gizmo,
//selection::delete_selected,
)
.run_if(in_state(EditorState::Editor).and_then(in_state(ShowEditorUi::Show))),
.run_if(in_state(EditorState::Editor).and(in_state(ShowEditorUi::Show))),
);

if self.disable_no_editor_cams {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn setup(mut commands: Commands) {
fn spin_entities(mut query: Query<(&mut Transform, &Spin)>, time: Res<Time>) {
for (mut transform, spin) in query.iter_mut() {
if spin.0 {
transform.rotate(Quat::from_rotation_y(spin.1 * time.delta_seconds()));
transform.rotate(Quat::from_rotation_y(spin.1 * time.delta_secs()));
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions examples/space_example.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
use bevy::prelude::*;
use bevy::{log::{Level, LogPlugin}, prelude::*};
use ext::bevy_inspector_egui::quick::WorldInspectorPlugin;
use space_editor::prelude::*;

fn main() {
App::default()
.add_plugins(DefaultPlugins)
.add_plugins(DefaultPlugins.set(
LogPlugin {
level: Level::TRACE,
..default()
}
))
.add_plugins(SpaceEditorPlugin)
.add_systems(Startup, simple_editor_setup)
.run();
Expand Down
2 changes: 1 addition & 1 deletion external/editor_as_plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = "0.14"
bevy = "0.15.1"
space_editor = { path = "../../"}
workspace-hakari = { version = "0.1", path = "../../workspace-hakari" }

Expand Down

0 comments on commit 65d1e46

Please sign in to comment.