FGameplayEffectContextHandle UGameplayAbility::GetEffectContext(const FGameplayAbilityActorInfo *ActorInfo) const { check(ActorInfo); FGameplayEffectContextHandle Context = FGameplayEffectContextHandle(UAbilitySystemGlobals::Get().AllocGameplayEffectContext()); // By default use the owner and avatar as the instigator and causer Context.AddInstigator(ActorInfo->OwnerActor.Get(), ActorInfo->AvatarActor.Get()); return Context; }
FGameplayEffectContextHandle UAbilitySystemBlueprintLibrary::GetEffectContext(FGameplayEffectSpecHandle SpecHandle) { FGameplayEffectSpec* Spec = SpecHandle.Data.Get(); if (Spec) { return Spec->GetEffectContext(); } else { ABILITY_LOG(Warning, TEXT("UAbilitySystemBlueprintLibrary::GetEffectContext called with invalid SpecHandle")); } return FGameplayEffectContextHandle(); }
FGameplayEffectSpecHandle UAbilitySystemBlueprintLibrary::MakeSpecHandle(UGameplayEffect* InGameplayEffect, AActor* InInstigator, AActor* InEffectCauser, float InLevel) { FGameplayEffectContext* EffectContext = new FGameplayEffectContext(InInstigator, InEffectCauser); return FGameplayEffectSpecHandle(new FGameplayEffectSpec(InGameplayEffect, FGameplayEffectContextHandle(EffectContext), InLevel)); }