I’ve been studying the source code of GAS recently, and I came across the function HasAttributeSetForAttribute(FGameplayAttribute Attribute) in AbilitySystemComponent.cpp.
I ran into some problems while trying to understand the IsSystemAttribute() function.
bool FGameplayAttribute::IsSystemAttribute() const
{
return GetAttributeSetClass()->IsChildOf(UAbilitySystemComponent::StaticClass());
}
In the code, it checks whether “AttributeSetClass“ is a subclass of UAbilitySystemComponent (ASC), even though ASC and AttributeSet don’t have any inheritance relationship. Why is it written this way?
Appreciate any help or insights!