SpiecsEngine
 
Loading...
Searching...
No Matches

◆ DrawComponent()

template<typename T >
void Spices::ImguiProperty::DrawComponent ( const std::string & name,
Entity entity )
staticprivate

Draw Entity Component on Property Panel.

Template Parameters
TComponent Class.
Parameters
[in]nameComponentName.
[in]entityEntity.

Definition at line 69 of file ImguiProperty.h.

70 {
71 if (entity.HasComponent<T>())
72 {
73 auto& component = entity.GetComponent<T>();
74
75 ImGuiH::DrawTreeTitle(name, nullptr, [&]() { component.DrawThis(); });
76 }
77 }
static void DrawTreeTitle(const std::string &treeName, std::function< void()> optionFunc, std::function< void()> treeFunc)
Draw a stylized tree title bar.

References Spices::ImGuiH::DrawTreeTitle().