更新 Source/FLESHEditor/Private/DismembermentExecutor.cpp

This commit is contained in:
2025-04-21 18:18:57 +08:00
parent 04811a0ab9
commit 0ee109a209

View File

@@ -148,7 +148,7 @@ bool UDismembermentExecutor::ApplyCut(const FVector& Location, const FVector& Di
if (CutResults.Num() >= 2)
{
// Replace the original skeletal mesh with the first cut result
TargetSkeletalMesh->SetSkeletalMesh(CutResults[0]);
TargetSkeletalMesh->SetSkeletalMeshAsset(CutResults[0]);
// TODO: Handle the second cut result (detached part)
// This would involve creating a new actor with the second mesh
@@ -171,7 +171,7 @@ bool UDismembermentExecutor::ApplyCut(const FVector& Location, const FVector& Di
if (CutResults.Num() >= 2)
{
// Replace the original skeletal mesh with the first cut result
TargetSkeletalMesh->SetSkeletalMesh(CutResults[0]);
TargetSkeletalMesh->SetSkeletalMeshAsset(CutResults[0]);
// TODO: Handle the second cut result (detached part)
// This would involve creating a new actor with the second mesh
@@ -326,7 +326,7 @@ bool UDismembermentExecutor::SpawnOrgan(UStaticMesh* OrganMesh, UMaterialInterfa
}
// Create a static mesh component for the organ
UStaticMeshComponent* OrganComponent = NewObject<UStaticMeshComponent>(TargetActor);
UStaticMeshComponent* OrganComponent = NewObject<UStaticMeshComponent>(TargetActor, TEXT("PreviewOrganComponent"));
if (!OrganComponent)
{
UE_LOG(LogTemp, Warning, TEXT("FLESH: Cannot spawn organ, failed to create static mesh component"));