Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 2021 Glass Bottom Games, all rights reserved, also all lefts reserved because Megan Fox is left-handed so it's only right, wait, oh no
- #pragma once
- #include "CoreMinimal.h"
- #include "NavLinkCustomComponent.h"
- #include "SurfaceableCustomNavLinkComponent.generated.h"
- DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSurfaceableCustomNavLinkReachedSignature, AActor*, MovingActor, const FVector&, DestinationPoint);
- UCLASS(meta = (BlueprintSpawnableComponent), Classgroup = "Navigation")
- class BIRDAHOY_API USurfaceableCustomNavLinkComponent : public UNavLinkCustomComponent
- {
- GENERATED_BODY()
- public:
- #if WITH_EDITOR
- virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
- #endif // WITH_EDITOR
- virtual void OnRegister() override;
- /**
- * @brief Sets default values for this component's properties
- * @param ObjectInitializer
- */
- USurfaceableCustomNavLinkComponent(const FObjectInitializer& ObjectInitializer);
- UPROPERTY(BlueprintAssignable)
- FSurfaceableCustomNavLinkReachedSignature OnSmartLinkReached;
- void NotifySmartLinkReached(UNavLinkCustomComponent* LinkComp, UObject* PathingAgent, const FVector& DestPoint);
- /**
- * @brief called when agent reaches smart link during path following, use ResumePathFollowing() to give control back
- * @param Agent
- * @param Destination
- */
- UFUNCTION(BlueprintImplementableEvent)
- void ReceiveSmartLinkReached(AActor* Agent, const FVector& Destination);
- /** resume normal path following */
- UFUNCTION(BlueprintCallable, Category = SmartLink)
- void SmartLinkResumePathFollowing(AActor* Agent);
- /** check if smart link is enabled */
- UFUNCTION(BlueprintCallable, Category = SmartLink)
- bool IsSmartLinkRelevant() const;
- /** check if any agent is moving through smart link right now */
- UFUNCTION(BlueprintCallable, Category = SmartLink)
- bool SmartLinkHasMovingAgents() const;
- /**
- * @brief Assigns data through to the smart link, in a simplified way that BP can interact with
- * @param relStartPoint the relative starting point of the link
- * @param relEndPoint the relative ending point of the link
- * @param bBothWays if true, the link is traversable both ways, if false, only from start to end
- */
- UFUNCTION(BlueprintCallable, Category = SmartLink)
- void SetSmartLinkData(FVector relStartPoint, FVector relEndPoint, bool bBothWays);
- protected:
- public:
- /**
- * @brief Toggles the relevancy of this smart link
- */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = SmartLink)
- bool bSmartLinkIsRelevant;
- protected:
- };
Advertisement
Add Comment
Please, Sign In to add comment