Updated
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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
|
||||
|
38
Source/FLESH/Public/DismembermentGraph/DismembermentGraph.h
Normal file
38
Source/FLESH/Public/DismembermentGraph/DismembermentGraph.h
Normal 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);
|
||||
};
|
@@ -2,6 +2,10 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UObject/NoExportTypes.h"
|
||||
|
||||
// Forward declaration
|
||||
class UDismembermentGraph;
|
||||
|
||||
#include "DismembermentGraphAsset.generated.h"
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user