Entity deletion

This commit is contained in:
2024-10-21 23:32:02 +02:00
parent 84bb7b1eaa
commit c2504ec624
6 changed files with 116 additions and 80 deletions

View File

@@ -153,6 +153,7 @@ editor_ui :: () {
{
new_entity := editor_ui_entity_creation();
if new_entity != null {
set_position(*new_entity.transform, engine.editor.camera.position + engine.editor.camera.forward * 20.0);
engine.editor.selected_entities.count = 0;
array_add(*engine.editor.selected_entities, new_entity);
}
@@ -249,6 +250,14 @@ base_editor_update :: () {
//show_message("Saved scene");
}
if key_down(.DELETE) || key_down(.BACKSPACE) {
for engine.editor.selected_entities {
mark_entity_deleted(it);
}
engine.editor.selected_entities.count = 0;
}
//if entity != null {
// // @Incomplete:@Incomplete: Duplicate
// //if key_pressed(.CTRL) && key_down(.D) {