41 lines
1.2 KiB
ActionScript
41 lines
1.2 KiB
ActionScript
class AddComponentRender {
|
|
Entity entity;
|
|
AddComponentRender(Entity _entity) {
|
|
entity = _entity;
|
|
}
|
|
|
|
void addComponentPopup() {
|
|
ImGui::titleCenter("\uf055 Add Component");
|
|
ImGui::separator();
|
|
ImGui::subMenu("Renderin ", SimpleFunction(this.addComponentRendering));
|
|
if (ImGui::menuItem("Script Component )) {
|
|
}
|
|
}
|
|
|
|
void addComponentRendering() {
|
|
if (entity.hasMeshComponent()) {
|
|
ImGui::menuItemDisabled("\uf248 Mesh Render Component");
|
|
} else {
|
|
if (ImGui::menuItem("\uf248 Mesh Render Component )) {
|
|
entity.createMeshComponent();
|
|
}
|
|
}
|
|
|
|
if (entity.hasShaderComponent()) {
|
|
ImGui::menuItemDisabled("\uf042 Shader Render Component");
|
|
} else {
|
|
if (ImGui::menuItem("\uf042 Shader Render Component )) {
|
|
entity.createShaderComponent();
|
|
}
|
|
}
|
|
|
|
if (entity.hasCameraComponent()) {
|
|
ImGui::menuItemDisabled("\uf030 Camera Component");
|
|
} else {
|
|
if (ImGui::menuItem("\uf030 Camera Component )) {
|
|
entity.createCameraComponent();
|
|
}
|
|
}
|
|
}
|
|
}
|