GamePlayTags:?
? ? ? ? 核心数据结构:AbilitySystemComponent::FGameplayTagCountContainer ?
????????主要用于区别Object以及描述Object的状态了;例如如果角色被Stun(眩晕)了,那么在Stun期间,我们可以给角色一个GamePlayTag:?State.Debuff.Stun ?
? ? ? ? 使用?FGameplayTag::RequestGameplayTag(FName("Your.GameplayTag.Name")) 来获得对GameplayTag的引用。
? ? ? ? 可以加入委托来对Tag数量变化做出相应:? ? ? ??
AbilitySystemComponent->RegisterGameplayTagEvent(FGameplayTag::RequestGameplayTag(FName("State.Debuff.Stun")), EGameplayTagEventType::NewOrRemoved).AddUObject(this, &AGDPlayerState::StunTagChanged);
? ? ? ? 其中RegisterGameplayTagEvent返回一个多播的数据结构,通过AddUobject来委托一个成员函数
//C++ AGDPlayerState 函数声明
virtual void StunTagChanged(const FGameplayTag CallbackTag, int32 NewCount);
Attributes
? ? ? ? 核心数据结构:FGameplayAttributeData
? ? ? ? 使用:为属于Actor的Gameplay数值设置属性
? ? ? ? 尽量使用GE来修改Attribute,这样就ASC可以预测值的变化
????????
????????
|