Lesson 105 - Set up move to click.
This commit is contained in:
@@ -4,17 +4,62 @@
|
||||
#include "AbilitySystem/AuraAbilitySystemComponent.h"
|
||||
|
||||
#include "AuraGameplayTags.h"
|
||||
#include "AbilitySystem/GameplayAbility/AuraGameplayAbility.h"
|
||||
|
||||
void UAuraAbilitySystemComponent::AbilityActorInfoSet()
|
||||
{
|
||||
OnGameplayEffectAppliedDelegateToSelf.AddUObject( this, &UAuraAbilitySystemComponent::EffectApplied);
|
||||
|
||||
const FAuraGameplayTags& GameplayTags = FAuraGameplayTags::Get();
|
||||
//const FAuraGameplayTags& GameplayTags = FAuraGameplayTags::Get();
|
||||
//GameplayTags.Attributes_Secondary_Armor.ToString();
|
||||
}
|
||||
|
||||
void UAuraAbilitySystemComponent::AddCharacterAbilities(const TArray<TSubclassOf<UGameplayAbility>>& StartupAbilities)
|
||||
{
|
||||
for (const TSubclassOf<UGameplayAbility> AbilityClass : StartupAbilities)
|
||||
{
|
||||
|
||||
FGameplayAbilitySpec AbilitySpec = FGameplayAbilitySpec(AbilityClass, 1); //Cannot be Const if GiveAbilityAndActivateOnce
|
||||
if (const UAuraGameplayAbility* AuraAbility = Cast<UAuraGameplayAbility>(AbilitySpec.Ability))
|
||||
{
|
||||
//AbilitySpec.DynamicAbilityTags is depreciated, use GetDynamicSpecSourceTags() instead.
|
||||
AbilitySpec.GetDynamicSpecSourceTags().AddTag(AuraAbility->StartupInputTag);
|
||||
GiveAbility(AbilitySpec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UAuraAbilitySystemComponent::AbilityInputTagHeld(const FGameplayTag& InputTag)
|
||||
{
|
||||
if (!InputTag.IsValid()) return;
|
||||
for (FGameplayAbilitySpec& AbilitySpec : GetActivatableAbilities())
|
||||
{
|
||||
//AbilitySpec.DynamicAbilityTags is depreciated, use GetDynamicSpecSourceTags() instead.
|
||||
if (AbilitySpec.GetDynamicSpecSourceTags().HasTagExact(InputTag))
|
||||
{
|
||||
AbilitySpecInputPressed(AbilitySpec);
|
||||
if (!AbilitySpec.IsActive())
|
||||
{
|
||||
TryActivateAbility(AbilitySpec.Handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UAuraAbilitySystemComponent::AbilityInputTagReleased(const FGameplayTag& InputTag)
|
||||
{
|
||||
if (!InputTag.IsValid()) return;
|
||||
for (FGameplayAbilitySpec& AbilitySpec : GetActivatableAbilities())
|
||||
{
|
||||
//AbilitySpec.DynamicAbilityTags is depreciated, use GetDynamicSpecSourceTags() instead.
|
||||
if (AbilitySpec.GetDynamicSpecSourceTags().HasTagExact(InputTag))
|
||||
{
|
||||
AbilitySpecInputPressed(AbilitySpec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UAuraAbilitySystemComponent::EffectApplied(UAbilitySystemComponent* AbilitySystemComponent,
|
||||
const FGameplayEffectSpec& EffectSpec, FActiveGameplayEffectHandle ActiveEffectHandle)
|
||||
const FGameplayEffectSpec& EffectSpec, FActiveGameplayEffectHandle ActiveEffectHandle)
|
||||
{
|
||||
//GEngine->AddOnScreenDebugMessage(1,8.f, FColor::Blue,FString("Effect Applied!"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user