rewin123 / space_editor

bevy prefab editor
MIT License
372 stars 43 forks source link

Editor panels for debugging during game play #156

Open rewin123 opened 9 months ago

rewin123 commented 9 months ago

154 offers an interesting tool that will be particularly useful when debugging gameplay. Therefore, I propose to add the ability to display the editor UI during the game. And base a new UI on top of the existing editor UI and its tab mechanism. This would allow us to inspect the game state in real time, spawn objects for testing, send events, etc.

I think we can achieve this with minimal effort by introducing two checks for each editor tab.

trait EditorTab {
  fn visible_in_editor(&self) -> bool;
  fn visible_in_game(&self) -> bool;
}

And also store the tree of displayed tabs separately for editor and game debugging. The functionality will be close to bevy_editor_pls project, but broader and closer to Unity logic.

naomijub commented 9 months ago

What do you think about in game mode we spawn them as new windows?

Something like: If you press F1 a debug menu appears and you can select a tab to spawn as a new window.