728x90
반응형
인사말
안녕하세요. 오늘은 GAS 에 있는 UAbilitySystemComponent
와 UAttributeSet
클래스를 생성하겠습니다.
Build.cs Dependency Module 추가
- GameplayTags
- GameplayTasks
- GameplayAbilities
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "GameplayAbilities" });
PrivateDependencyModuleNames.AddRange(new string[] {"GameplayTags", "GameplayTasks" });
Aura Character Base
- UAbilitySystemComponent, UAttributeSet 와 IAbilitySystemInterface 를 추가합니다.
- IAbilitySystemInterface 는 virtual UAbilitySystemComponent* GetAbilitySystemComponent() 함수를 가지고 있다.
// Copyright mane
#pragma once
#include "AbilitySystemInterface.h"
#include "GameFramework/Character.h"
#include "AuraCharacterBase.generated.h"
class UAuraAbilitySystemComponent;
class UAttributeSet;
class UAbilitySystemComponent;
UCLASS(Abstract)
class AURA_API AAuraCharacterBase : public ACharacter, public IAbilitySystemInterface
{
GENERATED_BODY()
public:
AAuraCharacterBase();
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
UAttributeSet* GetAttributeSet() const {return AttributeSet;}
protected:
virtual void BeginPlay() override;
UPROPERTY(EditAnywhere, Category = "Combat")
TObjectPtr<USkeletalMeshComponent> Weapon;
UPROPERTY()
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
UPROPERTY()
TObjectPtr<UAttributeSet> AttributeSet;
};
Aura Player State
- Aura Player State 에도 동일하게 UAbilitySystemComponent, UAttributeSet 와 IAbilitySystemInterface 를 추가합니다.
// Copyright mane
#pragma once
#include "AbilitySystemInterface.h"
#include "GameFramework/PlayerState.h"
#include "AuraPlayerState.generated.h"
class UAttributeSet;
class UAbilitySystemComponent;
/**
*
*/
UCLASS()
class AURA_API AAuraPlayerState : public APlayerState, public IAbilitySystemInterface
{
GENERATED_BODY()
public:
AAuraPlayerState();
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
UAttributeSet* GetAttributeSet() const {return AttributeSet;}
protected:
UPROPERTY()
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
UPROPERTY()
TObjectPtr<UAttributeSet> AttributeSet;
};
728x90
반응형
'언리얼 엔진 > Gameplay Ability System - Udemy' 카테고리의 다른 글
[UE5/Gameplay Ability System(GAS)] - Effect Actor (0) | 2024.02.10 |
---|---|
Gameplay Ability System(GAS) - GAMEPLAYATTRIBUTE_REPNOTIFY (0) | 2024.02.10 |
Gameplay Ability System(GAS) - Post Process Volume Highlight (0) | 2024.02.05 |
Gameplay Ability System(GAS) - 캐릭터 움직임 및 하이라이트 (0) | 2024.02.05 |
Gameplay Ability System(GAS) - 애니메이션 블루프린트 (0) | 2024.02.01 |