can assign mesh

add bigobj option to command line till we find a better solution
This commit is contained in:
Sri Sham Haran 2022-10-30 23:15:41 +08:00
parent 0aebc3053f
commit d3dc87accb
5 changed files with 8 additions and 4 deletions

View File

@ -8,7 +8,7 @@ project "SHADE_Engine"
pchheader "SHpch.h"
pchsource "%{prj.location}/src/SHpch.cpp"
staticruntime "off"
buildoptions{"/bigobj"}
files
{
"%{prj.location}/src/**.h",

View File

@ -133,7 +133,7 @@ namespace SHADE
auto size = ImGui::GetWindowSize();
auto g = ImGui::GetCurrentContext();
ImGui::SetCursorPosX(size.x - g->Style.FramePadding.x * 15.0f);
if (ImGui::SmallButton(ICON_MD_DESELECT))
if (ImGui::SmallButton(ICON_MD_CLEAR_ALL))
{
auto editor = SHSystemManager::GetSystem<SHEditor>();
editor->selectedEntities.clear();

View File

@ -348,14 +348,16 @@ namespace SHADE
if (ImGui::CollapsingHeader(componentType.get_name().data()))
{
DrawContextMenu(component);
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Mesh", "Mesh Asset", [component]()
Handle<SHMesh> const& mesh = component->GetMesh();
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Mesh", std::to_string(SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0)).data(), [component]()
{
Handle<SHMesh> const& mesh = component->GetMesh();
return SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0);
},
[component](AssetID const& id)
{
//component->SetMesh(SHResourceManager::LoadOrGet<SHMesh>(id));
component->SetMesh(SHResourceManager::LoadOrGet<SHMesh>(id));
}, SHDragDrop::DRAG_RESOURCE);
}
else

View File

@ -136,6 +136,7 @@ namespace SHADE
{
DrawAddComponentButton<SHTransformComponent>(eid);
DrawAddComponentButton<SHCameraComponent>(eid);
DrawAddComponentButton<SHLightComponent>(eid);
// Components that require Transforms

View File

@ -239,6 +239,7 @@ namespace YAML
YAML::convert<SHCollider>::decode(colliderNode, rhs.GetCollider(numColliders++));
}
}
return true;
}
};