71. Derived Attributes
This commit is contained in:
@ -65,9 +65,19 @@ AGasaCharacter::AGasaCharacter()
|
||||
}
|
||||
|
||||
#pragma region Ability System
|
||||
void AGasaCharacter::ApplyEffectToSelf(TSubclassOf<UGameplayEffect> GE, float Level)
|
||||
{
|
||||
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
|
||||
ensure(ASC);
|
||||
ensure(GE);
|
||||
FGameplayEffectContextHandle Context = ASC->MakeEffectContext();
|
||||
FGameplayEffectSpecHandle Spec = ASC->MakeOutgoingSpec(GE, Level, Context );
|
||||
ASC->ApplyGameplayEffectSpecToTarget( * Spec.Data, ASC );
|
||||
}
|
||||
|
||||
void AGasaCharacter::InitDefaultAttributes()
|
||||
{
|
||||
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
|
||||
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
|
||||
ensure(ASC);
|
||||
ensure(DefaultVitalAttributes);
|
||||
ensure(DefaultPrimaryAttributes);
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Ability System")
|
||||
TSubclassOf<UGameplayEffect> DefaultSecondaryAttributes;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void ApplyEffectToSelf(TSubclassOf<UGameplayEffect> GE, float Level);
|
||||
|
||||
void InitDefaultAttributes();
|
||||
#pragma endregion Ability System
|
||||
|
||||
|
Reference in New Issue
Block a user