Add target acquisition in the sample

This commit is contained in:
Arnaud Jamin
2023-10-06 02:27:00 -04:00
parent 25f2e06400
commit 92396410d4
36 changed files with 1657 additions and 97 deletions
@@ -11,12 +11,14 @@ struct FGameplayAttributeData;
struct FGameplayCueNotify_SpawnResult;
struct FGameplayCueParameters;
//--------------------------------------------------------------------------------------------------------------------------
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
//--------------------------------------------------------------------------------------------------------------------------
UCLASS(meta = (ScriptName = "CogSampleFunctionLibrary_Gameplay"))
class UCogSampleFunctionLibrary_Gameplay : public UBlueprintFunctionLibrary
{
@@ -24,8 +26,6 @@ class UCogSampleFunctionLibrary_Gameplay : public UBlueprintFunctionLibrary
public:
static void AdjustAttributeForMaxChange(UAbilitySystemComponent* AbilityComponent, FGameplayAttributeData& AffectedAttribute, float OldValue, float NewMaxValue, const FGameplayAttribute& AffectedAttributeProperty);
UFUNCTION(BlueprintPure)
static FVector GetActorBottomLocation(const AActor* Actor);
@@ -49,4 +49,28 @@ public:
UFUNCTION(BlueprintPure)
static int32 GetIntValue(const FScalableFloat& ScalableFloat, int32 Level);
UFUNCTION(BlueprintPure)
static FVector GetActorTargetLocation(const AActor* Actor);
UFUNCTION(BlueprintPure)
static float AngleBetweenVector2D(FVector2D A, FVector2D B);
UFUNCTION(BlueprintPure)
static void FindSegmentPointDistance(const FVector2D& Segment1, const FVector2D& Segment2, const FVector2D& Point, FVector2D& Projection, float& Time, float& Distance);
UFUNCTION(BlueprintPure)
static void FindCapsulePointDistance(const FVector2D& CapsulePoint1, const FVector2D& CapsulePoint2, const float CapsuleRadius, const FVector2D& Point, FVector2D& Projection, float& Time, float& Distance);
static void AdjustAttributeForMaxChange(UAbilitySystemComponent* AbilityComponent, FGameplayAttributeData& AffectedAttribute, float OldValue, float NewMaxValue, const FGameplayAttribute& AffectedAttributeProperty);
static FCollisionObjectQueryParams ConfigureCollisionObjectParams(const TArray<TEnumAsByte<EObjectTypeQuery>>& ObjectTypes);
static FVector2D ViewportToScreen(const FVector2D& value, const FVector2D& displaySize);
static float ViewportToScreen(const float value, const FVector2D& displaySize);
static FVector2D ScreenToViewport(const FVector2D& value, const FVector2D& displaySize);
static float ScreenToViewport(const float value, const FVector2D& displaySize);
};