This commit is contained in:
2025-04-18 10:46:49 +08:00
parent 88536f22da
commit 2915f46389
17 changed files with 171 additions and 105 deletions

View File

@@ -66,9 +66,9 @@ void ABloodPool::SetPoolColor(const FLinearColor& NewColor)
}
}
void ABloodPool::StartExpansion(float ExpansionRate, float MaxSize)
void ABloodPool::StartExpansion(float InExpansionRate, float MaxSize)
{
this->ExpansionRate = ExpansionRate;
ExpansionRate = InExpansionRate;
MaxPoolSize = MaxSize;
bIsExpanding = true;

View File

@@ -0,0 +1,50 @@
#include "DismembermentGraph/DismembermentGraph.h"
#include "EdGraph/EdGraphNode.h"
#include "EdGraph/EdGraphPin.h"
UDismembermentGraph::UDismembermentGraph()
: bCompiled(false)
{
}
void UDismembermentGraph::ClearGraph()
{
// Clear all nodes
Nodes.Empty();
bCompiled = false;
}
UEdGraphNode* UDismembermentGraph::AddNode(TSubclassOf<UEdGraphNode> NodeClass, const FVector2D& Position)
{
// Create new node
UEdGraphNode* NewNode = NewObject<UEdGraphNode>(this, NodeClass);
if (NewNode)
{
// Set node position
NewNode->NodePosX = Position.X;
NewNode->NodePosY = Position.Y;
// Add to node list
Nodes.Add(NewNode);
}
return NewNode;
}
void UDismembermentGraph::RemoveNode(UEdGraphNode* Node)
{
// Remove from node list
if (Node)
{
Nodes.Remove(Node);
}
}
void UDismembermentGraph::CreateConnection(UEdGraphPin* A, UEdGraphPin* B)
{
// Create connection
if (A && B)
{
A->MakeLinkTo(B);
}
}

View File

@@ -42,11 +42,11 @@ public:
/**
* Start blood pool expansion
* @param ExpansionRate - Rate of expansion
* @param InExpansionRate - Rate of expansion
* @param MaxSize - Maximum size
*/
UFUNCTION(BlueprintCallable, Category = "FLESH|Blood")
void StartExpansion(float ExpansionRate = 1.0f, float MaxSize = 3.0f);
void StartExpansion(float InExpansionRate = 1.0f, float MaxSize = 3.0f);
private:
// Collision component for surface detection

View File

@@ -0,0 +1,38 @@
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "DismembermentGraph.generated.h"
/**
* Dismemberment graph class
* Used for visual programming of dismemberment logic
*/
UCLASS()
class FLESH_API UDismembermentGraph : public UObject
{
GENERATED_BODY()
public:
UDismembermentGraph();
// Graph nodes
UPROPERTY()
TArray<class UEdGraphNode*> Nodes;
// Compilation status
UPROPERTY()
bool bCompiled;
// Clear graph
void ClearGraph();
// Add node
class UEdGraphNode* AddNode(TSubclassOf<class UEdGraphNode> NodeClass, const FVector2D& Position);
// Remove node
void RemoveNode(class UEdGraphNode* Node);
// Create connection
void CreateConnection(class UEdGraphPin* A, class UEdGraphPin* B);
};

View File

@@ -2,6 +2,10 @@
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
// Forward declaration
class UDismembermentGraph;
#include "DismembermentGraphAsset.generated.h"
/**