更新 Source/FLESH/Private/DismembermentGraph/DismembermentGraphBase.cpp

This commit is contained in:
2025-04-21 17:58:49 +08:00
parent 4c86374b15
commit b7f2056dbe

View File

@@ -19,8 +19,9 @@ void UDismembermentGraphBase::ClearGraph()
UEdGraphNode* UDismembermentGraphBase::AddNode(TSubclassOf<UEdGraphNode> NodeClass, const FVector2D& Position) UEdGraphNode* UDismembermentGraphBase::AddNode(TSubclassOf<UEdGraphNode> NodeClass, const FVector2D& Position)
{ {
// Create new node // Create new node with a unique name
UEdGraphNode* NewNode = NewObject<UEdGraphNode>(this, NodeClass); FString NodeName = FString::Printf(TEXT("Node_%s_%d"), *NodeClass->GetName(), Nodes.Num());
UEdGraphNode* NewNode = NewObject<UEdGraphNode>(this, NodeClass, *NodeName, RF_Transactional);
if (NewNode) if (NewNode)
{ {
// Set node position // Set node position