document.write("
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "DandelionAbilitySet.generated.h"
class UInputActionGameplayAbilityMappings;
class UAbilitySystemComponent;
class UGameplayAbility;
/**
* Convenience AbilitySet DataAsset that contains a set of GAs and will ensure the correct InputIDs get mapped to the
* GAs when they are granted if they are present in the provided UInputActionGameplayAbilityMappings.
* TODO: Look into having the correct InputIDs get bound somewhere else, since having it happen here requires IAGAs be
* granted through one of these AbilitySets.
*/
UCLASS()
class DANDELION_API UDandelionAbilitySet : public UDataAsset
{
GENERATED_BODY()
public:
/**
* The list of abilities contained within this AbilitySet.
*/
UPROPERTY(EditDefaultsOnly, Category = GameplayAbilities)
TSet<TSubclassOf<UGameplayAbility>> Abilities;
/**
* Iterates through the set of GAs and attempts to give the ability to the provided ASC.
* @param AbilitySystemComponent The ASC that will be granted the abilities.
* @param InputActionGameplayAbilityMappings The IAGA mappings that will be used to map IAs to GAs when binding.
*/
void GiveAbilities(
UAbilitySystemComponent* AbilitySystemComponent,
const UInputActionGameplayAbilityMappings* InputActionGameplayAbilityMappings = nullptr
) const;
private:
/**
* Helper function that grants a particular GA to the provided ASC. If a mapping from IA to GA is present, the
* InputID will get bound when the GA is granted.
* @param AbilitySystemComponent The ASC that will be granted the ability.
* @param InputActionGameplayAbilityMappings The IAGA mappings that will be checked for a mapping to find the proper
* InputID.
* @param Ability The GameplayAbility class that is about to be granted.
*/
static void GiveAbility(
UAbilitySystemComponent* AbilitySystemComponent,
const UInputActionGameplayAbilityMappings* InputActionGameplayAbilityMappings,
const TSubclassOf<UGameplayAbility>& Ability
);
};
DandelionAbilitySet.h - Snippet hosted by \"Cacher\"
");