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

59 lines
2.2 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "UObject/NoExportTypes.h"
#include "Components/SphereComponent.h"
#include "Templates/SubclassOf.h"
#include "TrackBuilderConnectPoint.generated.h"
class ATrackBuilderSegment;
class UTrackBuilderConnectPoint;
UCLASS(Blueprintable, EditInlineNew, ClassGroup=Custom, meta=(BlueprintSpawnableComponent))
class FSD_API UTrackBuilderConnectPoint : public USphereComponent {
GENERATED_BODY()
public:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FConnectionDelegate, UTrackBuilderConnectPoint*, InConnectPoint, ATrackBuilderSegment*, InSegment);
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FConnectionDelegate OnConnectedWithSegment;
protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSubclassOf<ATrackBuilderSegment> ConnectType;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, ReplicatedUsing=OnRep_ConnectedSegment, meta=(AllowPrivateAccess=true))
TWeakObjectPtr<ATrackBuilderSegment> ConnectedSegment;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float MaxConnectRadius;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float ConnectDistance;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FVector MaxAngles;
public:
UTrackBuilderConnectPoint();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
protected:
UFUNCTION(BlueprintCallable)
void OnRep_ConnectedSegment();
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, BlueprintPure)
FTransform GetConnectTransform(const FTransform& FromWorldTransform);
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable)
bool Disconnect(ATrackBuilderSegment* InSegment);
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable)
bool Connect(ATrackBuilderSegment* InSegment);
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, BlueprintPure)
bool CanConnectWith(ATrackBuilderSegment* InSegment, const FTransform& FromWorldTransform);
};