Skip to content

Commit

Permalink
Add UI options for creating particle emitters.
Browse files Browse the repository at this point in the history
  • Loading branch information
MStachowicz committed Apr 7, 2024
1 parent f1a5328 commit f8334dd
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions source/UI/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,18 +635,33 @@ namespace UI
Component::Mesh{m_mesh_system.m_cube},
Component::Collider{});
}
else if (ImGui::Button("Light"))
else if (ImGui::Button("Terrain"))
{
m_scene_system.get_current_scene_entities().add_entity(
Component::Label{"Terrain"},
Component::Terrain{*m_cursor_intersection, 10, 10});
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Light"))
{
if (ImGui::Button("Point light"))
{
m_scene_system.get_current_scene_entities().add_entity(
Component::Label{"Light"},
Component::Transform{*m_cursor_intersection},
Component::PointLight{*m_cursor_intersection});
}
else if (ImGui::Button("Terrain"))
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Particle"))
{
if (ImGui::Button("Smoke"))
{
m_scene_system.get_current_scene_entities().add_entity(
Component::Label{"Terrain"},
Component::Terrain{*m_cursor_intersection, 10, 10});
Component::Label{"Particle Emitter"},
Component::Transform{*m_cursor_intersection},
Component::ParticleEmitter{m_texture_system.getTexture(Config::Texture_Directory / "smoke.png")});
}
ImGui::EndMenu();
}
Expand Down

0 comments on commit f8334dd

Please sign in to comment.