1. Target.cs 변경
using UnrealBuildTool;
using System.Collections.Generic;
public class AuraEditorTarget : TargetRules
{
public AuraEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
CppStandard = CppStandardVersion.Cpp20;
ExtraModuleNames.AddRange( new string[] { "Aura" } );
}
}
- C++ 표준이 C++ 17에서 C++ 20으로 변경되었다.
- 빌드 세팅 버전이 V2에서 V5로 변경되었다.
2. 코드 변경
(1) FOverlapResult 구조체
이전 버전과 다르게 오버랩 된 결과를 사용하기 위해서는 아래의 헤더를 첨부해야 한다.
#include "Engine/OverlapResult.h"
(2) 어빌리티의 게임플레이 태그 컨테이너 접근
어빌리티 스펙의 어빌리티 태그 컨테이너에 접근할 때, 직접 접근하지 않고 Getter로 접근하도록 변경되었다.
FGameplayAbilitySpec LoadedAbilitySpec = FGameplayAbilitySpec(LoadedAbilityClass, Data.AbilityLevel);
LoadedAbilitySpec.DynamicAbilityTags.AddTag(Data.AbilitySlot);
LoadedAbilitySpec.DynamicAbilityTags.AddTag(Data.AbilityStatus);
FGameplayAbilitySpec LoadedAbilitySpec = FGameplayAbilitySpec(LoadedAbilityClass, Data.AbilityLevel);
LoadedAbilitySpec->GetDynamicSpecSourceTags().AddTag(Data.AbilitySlot);
LoadedAbilitySpec->GetDynamicSpecSourceTags().AddTag(Data.AbilityStatus);
어빌리티의 에셋 태그 컨테이너 에 접근할 때, 직접 접근하지 않고 Getter로 접근하도록 변경되었다.
void UAuraPassiveAbility::ReceiveDeactivate(const FGameplayTag& AbilityTag)
{
if (AbilityTags.HasTagExact(AbilityTag))
{
EndAbility(CurrentSpecHandle, CurrentActorInfo, CurrentActivationInfo, true, true);
}
}
void UAuraPassiveAbility::ReceiveDeactivate(const FGameplayTag& AbilityTag)
{
if (GetAssetTags().HasTagExact(AbilityTag))
{
EndAbility(CurrentSpecHandle, CurrentActorInfo, CurrentActivationInfo, true, true);
}
}
(3) 입력 레플리케이션 변경
//InvokeReplicatedEvent(EAbilityGenericReplicatedEvent::InputPressed, AbilitySpec.Handle, AbilitySpec.ActivationInfo.GetActivationPredictionKey());
향상된 입력(Enhanced Input)의 변경점과 더불어 GAS 내부의 레플리케이션 변경으로 인해 비 인스턴스화 된 어빌리티에 접근할 수 없게 되었다.
향상된 입력이 변경됨에 따라서 AbilitySpecInputPressed가 ASC에서 호출되면 자동으로 어빌리티의 InputPress 함수가 호출되도록 변경되었다.
(4) 게임플레이 이펙트가 부여하는 태그 컨테이너에 접근 변화
Effect->InheritableOwnedTagsContainer.AddTag(DebuffTag);
// 스턴 상태
if (DebuffTag.MatchesTagExact(GameplayTags.Debuff_Stun))
{
Effect->InheritableOwnedTagsContainer.AddTag(GameplayTags.Player_Block_CursorTrace);
Effect->InheritableOwnedTagsContainer.AddTag(GameplayTags.Player_Block_InputHeld);
Effect->InheritableOwnedTagsContainer.AddTag(GameplayTags.Player_Block_InputPressed);
Effect->InheritableOwnedTagsContainer.AddTag(GameplayTags.Player_Block_InputReleased);
}
생성한 게임플레이 이펙트가 액터에 적용되기 전에 특정 태그를 추가하려면 GrantedTag를 활용하도록 변경되었다.
FGameplayEffectSpec* MutableSpec = new FGameplayEffectSpec(Effect, EffectContext, 1.f/*Debuff Level*/);
if (MutableSpec)
{
FAuraGameplayEffectContext* AuraContext = static_cast<FAuraGameplayEffectContext*>(EffectContext.Get());
TSharedPtr<FGameplayTag> DebuffDamageType = MakeShareable(new FGameplayTag(DamageType));
AuraContext->SetDamageType(DebuffDamageType);
// 디버프 태그 적용
MutableSpec->DynamicGrantedTags.AddTag(DebuffTag);
if (DebuffTag.MatchesTagExact(GameplayTags.Debuff_Stun))
{
MutableSpec->DynamicGrantedTags.AddTag(GameplayTags.Player_Block_CursorTrace);
MutableSpec->DynamicGrantedTags.AddTag(GameplayTags.Player_Block_InputHeld);
MutableSpec->DynamicGrantedTags.AddTag(GameplayTags.Player_Block_InputPressed);
MutableSpec->DynamicGrantedTags.AddTag(GameplayTags.Player_Block_InputReleased);
}
}
'UE 5 스터디 > Gameplay Ability System(GAS)' 카테고리의 다른 글
32-15. 로그 라이크 - (7) 데미지 계산(ExecCalc) - (1) 속성 추가 데미지 업그레이드 (0) | 2025.07.02 |
---|---|
24-2. 엔진 업그레이드 - (1) 게임플레이 어빌리티 - (1) 아케인 파편 수정 (0) | 2025.06.30 |
24. 언리얼 엔진 업그레이드 (UE 5.2 -> UE 5.6) (0) | 2025.06.30 |
32-14. 로그 라이크 - (3) 게임플레이 어빌리티 - (5) 화염 폭풍 스펠 (0) | 2025.06.27 |
32-13. 로그 라이크 - (6) 보스 - (3) 보스 속성 개선, 공격력 개선, 스펠 개선 (0) | 2025.06.19 |