Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Public/NavModifierVolume.h
Stephen Holmes a5964e99b8 Consistent use of WITH_EDITOR as compared with NavModifierComponent, NavLinkProxy and NavLinkCustomComponent
#review
#jira none
#preflight 63da32929f6dbf248dcb3ca6

[CL 23945493 by Stephen Holmes in ue5-main branch]
2023-02-01 04:46:11 -05:00

68 lines
2.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Templates/SubclassOf.h"
#include "AI/Navigation/NavRelevantInterface.h"
#include "AI/Navigation/NavigationTypes.h"
#include "NavAreas/NavArea.h"
#include "GameFramework/Volume.h"
#include "NavModifierVolume.generated.h"
struct FNavigationRelevantData;
/**
* Allows applying selected AreaClass to navmesh, using Volume's shape
*/
UCLASS(hidecategories=(Navigation))
class NAVIGATIONSYSTEM_API ANavModifierVolume : public AVolume, public INavRelevantInterface
{
GENERATED_BODY()
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Default)
TSubclassOf<UNavArea> AreaClass;
/** Experimental: if set, the 2D space occupied by the volume box will ignore FillCollisionUnderneathForNavmesh */
UPROPERTY(EditAnywhere, Category = Default, AdvancedDisplay)
bool bMaskFillCollisionUnderneathForNavmesh;
/** Experimental: When not set to None, the navmesh tiles touched by the navigation modifier volume will be built
* using the highest resolution found. */
UPROPERTY(EditAnywhere, Category = Default, AdvancedDisplay)
ENavigationDataResolution NavMeshResolution;
#if WITH_EDITOR
FDelegateHandle OnNavAreaRegisteredDelegateHandle;
FDelegateHandle OnNavAreaUnregisteredDelegateHandle;
#endif
public:
ANavModifierVolume(const FObjectInitializer& ObjectInitializer);
UFUNCTION(BlueprintCallable, Category = "AI|Navigation")
void SetAreaClass(TSubclassOf<UNavArea> NewAreaClass = nullptr);
TSubclassOf<UNavArea> GetAreaClass() const { return AreaClass; }
virtual void GetNavigationData(FNavigationRelevantData& Data) const override;
virtual FBox GetNavigationBounds() const override;
virtual void RebuildNavigationData() override;
#if WITH_EDITOR
virtual void PostEditUndo() override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif
protected:
virtual void PostInitProperties() override;
virtual void BeginDestroy() override;
#if WITH_EDITOR
void OnNavAreaRegistered(const UWorld& World, const UClass* NavAreaClass);
void OnNavAreaUnregistered(const UWorld& World, const UClass* NavAreaClass);
#endif
};