DRG-Femboy-Voice/Source/FSD/Public/SplineCableActor.h
2025-04-15 12:39:31 -07:00

88 lines
3.1 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "UObject/NoExportTypes.h"
#include "GameFramework/Actor.h"
#include "CablePathSettings.h"
#include "SplineCableActor.generated.h"
class UMaterialInterface;
class USplineComponent;
class USplineMeshComponent;
class UStaticMesh;
UCLASS(Abstract, Blueprintable)
class FSD_API ASplineCableActor : public AActor {
GENERATED_BODY()
public:
protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true))
USplineComponent* PathSplineComponent;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FCablePathSettings PathSettings;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSoftObjectPtr<UStaticMesh> CableMesh;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float CableThickness;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
int32 CarveRadius;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSoftObjectPtr<UMaterialInterface> MaterialConnected;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSoftObjectPtr<UMaterialInterface> MaterialUnconnected;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
int32 MaterialIndex;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
UStaticMesh* CableMeshInstance;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FTransform StartTransform;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FTransform EndTransform;
UPROPERTY(BlueprintReadWrite, EditAnywhere, ReplicatedUsing=OnRep_Path, meta=(AllowPrivateAccess=true))
TArray<FVector> ReplicatedPath;
UPROPERTY(BlueprintReadWrite, EditAnywhere, ReplicatedUsing=OnRep_Connected, meta=(AllowPrivateAccess=true))
bool bConnected;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, Transient, meta=(AllowPrivateAccess=true))
TArray<USplineMeshComponent*> MeshComponents;
public:
ASplineCableActor();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable)
void SpawnBetweenTransforms(FTransform InStart, FTransform InEnd);
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable)
void SetConnected(bool InConnected);
protected:
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void ReceiveSegmentCreated(USplineMeshComponent* InSegment, int32 InIndex, int32 InTotal);
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void ReceiveAllSegmentsCreated();
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void OnUpdateMaterials();
UFUNCTION(BlueprintCallable)
void OnRep_Path();
UFUNCTION(BlueprintCallable)
void OnRep_Connected();
};