Removed material num check
This commit is contained in:
parent
5d31f0d65e
commit
efb538dab3
|
@ -216,26 +216,16 @@ TArray<AStaticMeshActor *> UPrepareAssetsForCookingCommandlet::SpawnMeshesToWorl
|
||||||
// tag
|
// tag
|
||||||
if (AssetName.Contains(SSTags::R_MARKING1) || AssetName.Contains(SSTags::R_MARKING2))
|
if (AssetName.Contains(SSTags::R_MARKING1) || AssetName.Contains(SSTags::R_MARKING2))
|
||||||
{
|
{
|
||||||
if (MeshActor->GetStaticMeshComponent()->GetNumMaterials() == 1)
|
for (int32 i = 0; i < MeshActor->GetStaticMeshComponent()->GetStaticMesh()->StaticMaterials.Num(); ++i)
|
||||||
{
|
{
|
||||||
bool FoundColorName = true;
|
if (MeshActor->GetStaticMeshComponent()->GetStaticMesh()->StaticMaterials[i].ImportedMaterialSlotName.ToString().Contains("Yellow"))
|
||||||
for (int32 i = 0; i < MeshActor->GetStaticMeshComponent()->GetStaticMesh()->StaticMaterials.Num() && FoundColorName == false; ++i)
|
|
||||||
{
|
{
|
||||||
if (MeshActor->GetStaticMeshComponent()->GetStaticMesh()->StaticMaterials[i].ImportedMaterialSlotName.ToString().Contains("Yellow"))
|
MeshActor->GetStaticMeshComponent()->SetMaterial(i, MarkingNodeYellow);
|
||||||
{
|
}
|
||||||
MeshActor->GetStaticMeshComponent()->SetMaterial(0, MarkingNodeYellow);
|
else
|
||||||
FoundColorName = true;
|
{
|
||||||
}
|
MeshActor->GetStaticMeshComponent()->SetMaterial(i, MarkingNodeWhite);
|
||||||
else
|
|
||||||
{
|
|
||||||
MeshActor->GetStaticMeshComponent()->SetMaterial(0, MarkingNodeWhite);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MeshActor->GetStaticMeshComponent()->SetMaterial(0, MarkingNodeWhite);
|
|
||||||
MeshActor->GetStaticMeshComponent()->SetMaterial(1, MarkingNodeYellow);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (AssetName.Contains(SSTags::R_ROAD1) || AssetName.Contains(SSTags::R_ROAD2))
|
else if (AssetName.Contains(SSTags::R_ROAD1) || AssetName.Contains(SSTags::R_ROAD2))
|
||||||
|
|
Loading…
Reference in New Issue