GAS 介绍
{{ currentPage ? currentPage.title : "" }}
UGameplayAbility 分为Spec中的默认GameplayAbility与实例化的GameplayAbilityInstance
应用GE:
//创建效果环境
FGameplayEffectContextHandle EffectContext = AbilitySystemComponent->MakeEffectContext();
EffectContext.AddSourceObject(this);
//创建效果实例Handle
FGameplayEffectSpecHandle EffectSpecHandle = AbilitySystemComponent->MakeOutgoingSpec(InGameplayEffect,5, EffectContext);
if (EffectSpecHandle.IsValid())
{
//应用效果至目标
AbilitySystemComponent->ApplyGameplayEffectSpecToTarget(*EffectSpecHandle.Data,AbilitySystemComponent);
}
可通过AssignTagSetByCallerMagnitude设置GE数值
为玩家添加GC:
void UAbilitySystemComponent::AddGameplayCue(const FGameplayTag GameplayCueTag, const FGameplayCueParameters& GameplayCueParameters)
{{{ content }}}