UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FoliageHelper.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
12{
13public:
14#if WITH_EDITOR
15 static inline FName GetFoliageActorInstanceTag()
16 {
17 static FName NAME_FoliageActorInstanceTag(TEXT("FoliageActorInstance"));
19 }
20
21 static inline void SetIsOwnedByFoliage(AActor* InActor, bool bOwned = true)
22 {
23 if (InActor)
24 {
26 if (bOwned)
27 {
28 InActor->Tags.AddUnique(GetFoliageActorInstanceTag());
29 }
30 else
31 {
32 InActor->Tags.Remove(GetFoliageActorInstanceTag());
33 }
34 }
35 }
36
37 static inline bool IsOwnedByFoliage(const AActor* InActor)
38 {
39 return InActor && InActor->ActorHasTag(GetFoliageActorInstanceTag());
40 }
41#endif
42};
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Actor.h:257
Definition FoliageHelper.h:12
Definition NameTypes.h:617