附录B 术语与 API 速查
目标:一份可随时翻阅的 GAS 术语表与常用 API 清单。API 以 UE 5.4/5.5 为准。
B.1 术语表
| 缩写/术语 |
全称 |
含义 |
| GAS |
Gameplay Ability System |
游戏能力系统 |
| ASC |
AbilitySystemComponent |
GAS 核心组件,管理器 |
| GA |
GameplayAbility |
能力(技能逻辑) |
| GE |
GameplayEffect |
效果(属性修改规则) |
| AS |
AttributeSet |
属性集(数值定义) |
| GCN |
GameplayCueNotify |
表现层通知(Static/Actor) |
| MMC |
ModifierMagnitudeCalculation |
单修改器数值计算类 |
| EC |
ExecutionCalculation |
完整执行计算类 |
| Task |
GameplayTask / AbilityTask |
异步任务 |
| Spec |
GameplayEffectSpec |
GE 的运行时实例(配置+参数) |
| Handle |
FGameplayEffectSpecHandle / ActiveGEHandle |
引用句柄 |
| TargetData |
FGameplayAbilityTargetDataHandle |
目标数据 |
| Meta Attribute |
— |
中间计算属性(如 Damage),用后清零 |
| SetByCaller |
— |
运行时按 Tag 指定数值 |
| Prediction Key |
FPredictionKey |
客户端预测凭证 |
| ScopedPredictionWindow |
FScopedPredictionWindow |
预测作用域 |
| Loose Tag |
— |
手动添加、默认不复制的标签 |
| Granted Tags |
— |
GE 生效期间授予目标的标签 |
| ReplicationMode |
EGameplayEffectReplicationMode |
Full/Mixed/Minimal |
B.2 ASC 常用 API
| API |
说明 |
InitAbilityActorInfo(Owner, Avatar) |
初始化(Owner/Avatar 分离) |
SetReplicationMode(Mode) |
设复制模式 |
GiveAbility(Spec) / ClearAbility(Handle) |
授予/移除能力 |
GiveAbilityAndActivateOnce(Spec) |
授予并激活一次 |
TryActivateAbility(Handle) |
尝试激活 |
TryActivateAbilitiesByTag(Tags) |
按 Tag 激活 |
ApplyGameplayEffectToSelf(GE, Level, Ctx) |
对自己施加 |
ApplyGameplayEffectToTarget(GE, Target, Level, Ctx) |
对目标施加 |
MakeOutgoingSpec(GE, Level, Ctx) |
创建待施加的 Spec |
ApplyGameplayEffectSpecToSelf/Target(Spec) |
施加 Spec |
RemoveActiveGameplayEffect(Handle) |
移除效果 |
HasMatchingGameplayTag(Tag) |
标签判断 |
AddLooseGameplayTag / RemoveLooseGameplayTag |
手动标签(本地) |
GetNumericAttribute(Attr) |
取属性当前值 |
SetNumericAttributeBase(Attr, Value) |
设基础值 |
GetGameplayAttributeValueChangeDelegate(Attr) |
属性变更委托(UI) |
GetActiveEffects(Query) |
查询活跃效果 |
MakeEffectContext() |
创建效果上下文 |
AbilityLocalInputPressed/Released(InputID) |
输入触发能力 |
GetGameplayEffectFromActiveEffectHandle(Handle) |
由句柄取效果定义 |
B.3 GA 常用 API / 属性
| API / 属性 |
说明 |
CanActivateAbility() |
激活前检查 |
ActivateAbility() |
核心逻辑 |
CommitAbility() |
扣 Cost + 启 Cooldown |
EndAbility() |
结束(必须调用) |
CancelAbility() |
取消 |
GetAbilityLevel() |
技能等级 |
GetCooldownTimeRemaining() |
剩余冷却(BlueprintCallable) |
GetCooldownTags() |
冷却 Tag |
GetCooldownTimeRemainingAndDuration() |
冷却剩余+总时长 |
GetAbilitySystemComponentFromActorInfo() |
从 ActorInfo 取 ASC |
MakeOutgoingGameplayEffectSpec(GE, Level) |
生成 Spec |
K2_ExecuteGameplayCue / K2_AddGameplayCue / K2_RemoveGameplayCue |
触发/添加/移除 Cue |
InstancingPolicy |
实例化策略 |
NetExecutionPolicy |
网络执行策略 |
AbilityTags / CancelAbilitiesWithTag / BlockAbilitiesWithTag / ActivationOwnedTags / ActivationRequiredTags / ActivationBlockedTags |
标签配置 |
CostGameplayEffectClass / CooldownGameplayEffectClass |
成本/冷却 GE |
B.4 GE 常用配置
| 配置 |
说明 |
DurationPolicy |
Instant / HasDuration / Infinite |
Modifiers[](Attribute + Op + Magnitude) |
修改器列表 |
ModifierMagnitude |
ScalableFloat / AttributeBased / CustomCalculation / SetByCaller |
StackingType / StackLimitCount / 刷新/到期策略 |
堆叠 |
GrantedTags |
生效期间授予的标签 |
RemoveGameplayEffectsWithTags |
驱散其他效果 |
Application Requirements(Tag 条件) |
施加条件 |
Period |
周期效果间隔 |
GameplayCue 绑定 |
Execute/Add/Remove 表现 |
Executions[] |
ExecutionCalculation 列表 |
B.5 常用 Task
| Task |
用途 |
PlayMontageAndWait |
播放动画等待结束 |
WaitTargetData |
等待目标选择 |
WaitInputPress / WaitInputRelease |
等待输入 |
WaitDelay |
等待延迟 |
WaitGameplayEvent |
等待能力事件 |
WaitGameplayTagAdded / Removed |
等待标签变化 |
ApplyRootMotion* |
根运动(冲刺/击退) |
SpawnActor |
生成投射物等 |
B.6 调试命令
showdebug abilitysystem # 屏幕调试
AbilitySystem.Debug.NextCategory # 切换类别
AbilitySystem.Debug.NextTarget # 切换目标
AbilitySystem.Debug.ClearAll # 清除
Log AbilitySystem Verbose # 详细日志
stat game / stat network # 统计
B.7 命名约定速查(建议项目统一)
| 前缀 |
含义 |
示例 |
| GA_ |
能力 |
GA_Fireball |
| GE_ |
效果 |
GE_Damage |
| GC_ |
表现 |
GC_Impact_Fire |
| GCN_ |
表现通知类 |
GCN_AOE_Aura |
| AS / ASC |
属性集 / 组件 |
AS_Hero / ASC_Hero |
| EAbilityInputID |
输入枚举 |
EAbilityInputID::Fireball |
全书完。建议按 README 的学习路径从第 01 章开始,配合第 13 章实战把知识点落地。