Added full support for runtime editing of material properties #215
|
@ -368,8 +368,8 @@ namespace SHADE
|
|||
DrawContextMenu(component);
|
||||
Handle<SHMesh> const& mesh = component->GetMesh();
|
||||
Handle<SHMaterialInstance> const& mat = component->GetMaterial();
|
||||
|
||||
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Mesh", std::to_string(SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0)).data(), [component]()
|
||||
const auto MESH_NAME = SHResourceManager::GetAssetName<SHMesh>(mesh).value_or("");
|
||||
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Mesh", MESH_NAME, [component]()
|
||||
{
|
||||
Handle<SHMesh> const& mesh = component->GetMesh();
|
||||
return SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0);
|
||||
|
@ -380,10 +380,12 @@ namespace SHADE
|
|||
SHResourceManager::FinaliseChanges();
|
||||
}, SHDragDrop::DRAG_RESOURCE);
|
||||
|
||||
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Material", mat ? std::to_string(SHResourceManager::GetAssetID<SHMaterial>(mat->GetBaseMaterial()).value_or(0)).data() : "", [component]()
|
||||
const auto MAT_NAME = mat ? SHResourceManager::GetAssetName<SHMaterial>(mat->GetBaseMaterial()).value_or("") : "";
|
||||
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Material", MAT_NAME,
|
||||
[component]()
|
||||
{
|
||||
Handle<SHMaterialInstance> const& mat = component->GetMaterial();
|
||||
if(!mat)
|
||||
if (!mat)
|
||||
return static_cast<AssetID>(0);
|
||||
return SHResourceManager::GetAssetID<SHMaterial>(mat->GetBaseMaterial()).value_or(0);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue