Files
PHY/Plugins/GCS/Source/GenericGameplayAbilities/Public/AsyncTasks/GGA_AsyncTask_WaitGameplayAbilityEnded.h
2026-03-03 01:23:02 +08:00

40 lines
1.5 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Abilities/Async/AbilityAsync.h"
#include "GGA_AsyncTask_WaitGameplayAbilityEnded.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGGA_AbilityEndedDelegate, const FAbilityEndedData&, AbilityEndedData);
/**
* Given an Actor, OnAbilityEnded is triggered whenever the AbilityQuery's skill end is satisfied.
* 给定一个Actor只要满足AbilityQuery的技能结束就会触发OnAbilityEnded。
*/
UCLASS()
class GENERICGAMEPLAYABILITIES_API UGGA_AsyncTask_WaitGameplayAbilityEnded : public UAbilityAsync
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "GGA|Tasks", meta = (DefaultToSelf = "TargetActor", BlueprintInternalUseOnly = "TRUE"))
static UGGA_AsyncTask_WaitGameplayAbilityEnded* WaitGameplayAbilityEnded(AActor* TargetActor, FGameplayTagQuery AbilityQuery);
UFUNCTION(BlueprintCallable, Category = "GGA|Tasks", meta = (DefaultToSelf = "TargetActor", BlueprintInternalUseOnly = "TRUE"))
static UGGA_AsyncTask_WaitGameplayAbilityEnded* WaitAbilitySpecHandleEnded(AActor* TargetActor, FGameplayAbilitySpecHandle AbilitySpecHandle);
void HandleAbilityEnded(const FAbilityEndedData& Data);
UPROPERTY(BlueprintAssignable)
FGGA_AbilityEndedDelegate OnAbilityEnded;
protected:
virtual void Activate() override;
virtual void EndAction() override;
FGameplayTagQuery AbilityQuery;
FGameplayAbilitySpecHandle AbilitySpecHandle;
FDelegateHandle DelegateHandle;
};