Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ACK_CharacterPlayer 클래스 참조

#include <CK_CharacterPlayer.h>

ACK_CharacterPlayer에 대한 상속 다이어그램 :
Inheritance graph
ACK_CharacterPlayer에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

 ACK_CharacterPlayer ()
 
UAnimMontage * GetComboMontage () const
 
UComboActionDataGetComboActionData () const
 
FORCEINLINE UMotionWarpingComponent * GetMotionWarpingComponent () const
 
FORCEINLINE UStaticMeshComponent * GetWeaponMesh () const
 
- ACK_CharacterBase(으)로부터 상속된 Public 멤버 함수
 ACK_CharacterBase ()
 
virtual class UAbilitySystemComponent * GetAbilitySystemComponent () const override
 
void PlayDeadAnimation ()
 

Protected 멤버 함수

virtual void PostInitializeComponents () override
 
virtual void BeginPlay () override
 
virtual void PossessedBy (AController *NewController) override
 
virtual void SetupPlayerInputComponent (UInputComponent *PlayerInputComponent) override
 
void GASInputPressed (int32 InputId)
 
void GASInputReleased (int32 InputId)
 
void Move (const FInputActionValue &Value)
 
virtual void OnDeath ()
 
virtual void SetDead () override
 
virtual void InitializeAttributes () override
 

Protected 속성

TObjectPtr< UMotionWarpingComponent > MotionWarpingComponent
 
TObjectPtr< USpringArmComponent > SpringArm
 
TObjectPtr< UCameraComponent > FollowCamera
 
TObjectPtr< UStaticMeshComponent > WeaponMesh
 
TObjectPtr< UCharacterControlDataCharacterControlData
 
const FPlayerExtendedDataPlayerExtendedData = nullptr
 
- ACK_CharacterBase(으)로부터 상속된 Protected 속성
TObjectPtr< class UAbilitySystemComponent > ASC
 

생성자 & 소멸자 문서화

◆ ACK_CharacterPlayer()

ACK_CharacterPlayer::ACK_CharacterPlayer ( )
27{
28 SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
29 SpringArm->SetupAttachment(RootComponent);
30
31 SpringArm->TargetArmLength = 1200.0f;
32 SpringArm->SetRelativeRotation(FRotator(-45.f, -45.0f, 0.f));
33
34 SpringArm->bUsePawnControlRotation = false;
35 SpringArm->bInheritPitch = false;
36 SpringArm->bInheritYaw = false;
37 SpringArm->bInheritRoll = false;
38 SpringArm->bDoCollisionTest = false;
39
40 FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
41 FollowCamera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
42 FollowCamera->bUsePawnControlRotation = false;
43
44 GetCharacterMovement()->bOrientRotationToMovement = true;
45 GetCharacterMovement()->RotationRate = FRotator(0.0f,720.0f,0.0f);
46
47 ASC = nullptr;
48
49 WeaponMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WeaponMesh"));
50 WeaponMesh->SetupAttachment(GetMesh(), FName("WeaponSocket"));
51 WeaponMesh->SetCollisionProfileName(TEXT("NoCollision"));
52
53 MotionWarpingComponent = CreateDefaultSubobject<UMotionWarpingComponent>(TEXT("MotionWarpingComponent"));
54
55 GetCapsuleComponent()->SetCollisionProfileName(CPROFILE_CKPLAYERCAPSULE);
56}
#define CPROFILE_CKPLAYERCAPSULE
Definition CK_Collision.h:12
TObjectPtr< class UAbilitySystemComponent > ASC
Definition CK_CharacterBase.h:24
TObjectPtr< USpringArmComponent > SpringArm
Definition CK_CharacterPlayer.h:58
TObjectPtr< UMotionWarpingComponent > MotionWarpingComponent
Definition CK_CharacterPlayer.h:54
TObjectPtr< UCameraComponent > FollowCamera
Definition CK_CharacterPlayer.h:61
TObjectPtr< UStaticMeshComponent > WeaponMesh
Definition CK_CharacterPlayer.h:65

멤버 함수 문서화

◆ BeginPlay()

void ACK_CharacterPlayer::BeginPlay ( )
overrideprotectedvirtual
79{
80 Super::BeginPlay();
81
82 APlayerController* PlayerController = Cast<APlayerController>(GetController());
83 if (PlayerController && CharacterControlData)
84 {
86 {
87 if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
88 {
89 Subsystem->AddMappingContext(PlayerExtendedData->DefaultMappingContext, 0);
90 }
91 }
92 }
93}
const FPlayerExtendedData * PlayerExtendedData
Definition CK_CharacterPlayer.h:71
TObjectPtr< UCharacterControlData > CharacterControlData
Definition CK_CharacterPlayer.h:68
TObjectPtr< UInputMappingContext > DefaultMappingContext
Definition CharacterControlData.h:30

◆ GASInputPressed()

void ACK_CharacterPlayer::GASInputPressed ( int32  InputId)
protected
153{
154 if (FGameplayAbilitySpec* Spec = ASC->FindAbilitySpecFromInputID(InputId))
155 {
156 Spec->InputPressed = true;
157
158 if (Spec->IsActive())
159 {
160 ASC->AbilitySpecInputPressed(*Spec);
161 }
162 else
163 {
164 ASC->TryActivateAbility(Spec->Handle);
165 }
166 }
167}

◆ GASInputReleased()

void ACK_CharacterPlayer::GASInputReleased ( int32  InputId)
protected
170{
171 if (FGameplayAbilitySpec* Spec = ASC->FindAbilitySpecFromInputID(InputId))
172 {
173 Spec->InputPressed = false;
174
175 if (Spec->IsActive())
176 {
177 ASC->AbilitySpecInputReleased(*Spec);
178 }
179 }
180}

◆ GetComboActionData()

UComboActionData * ACK_CharacterPlayer::GetComboActionData ( ) const
64{
66}
TObjectPtr< UComboActionData > ComboActionData
Definition CharacterControlData.h:49

◆ GetComboMontage()

UAnimMontage * ACK_CharacterPlayer::GetComboMontage ( ) const
59{
61}

◆ GetMotionWarpingComponent()

FORCEINLINE UMotionWarpingComponent * ACK_CharacterPlayer::GetMotionWarpingComponent ( ) const
inline
28{ return MotionWarpingComponent; }

◆ GetWeaponMesh()

FORCEINLINE UStaticMeshComponent * ACK_CharacterPlayer::GetWeaponMesh ( ) const
inline
29{ return WeaponMesh; }

◆ InitializeAttributes()

void ACK_CharacterPlayer::InitializeAttributes ( )
overrideprotectedvirtual
234{
235 ACK_PlayerState* PS = GetPlayerState<ACK_PlayerState>();
236
237 if (!ASC || !CharacterControlData || !CharacterControlData->StatTable || !PS)
238 {
239 return;
240 }
241
242 UPlayerAttributeSet* PlayerAttributeSet = PS->GetPlayerAttributeSet();
243
244 FPlayerStatTableRow* StatRow = CharacterControlData->StatTable->FindRow<FPlayerStatTableRow>(CharacterControlData->StatRowName, TEXT("PlayerStatContext"));
245 if (!StatRow)
246 {
247 return;
248 }
249
250 if (!PlayerAttributeSet)
251 {
252 return;
253 }
254
255 // Base 공통 스탯 초기화
256 PlayerAttributeSet->InitBaseStats(
257 StatRow->Character_Hp,
258 StatRow->Character_Move_Speed,
259 StatRow->Character_Attack,
260 StatRow->Character_Attack_Speed,
261 StatRow->Character_Stun
262 );
263
264 // Player 전용 스탯 초기화
265 PlayerAttributeSet->InitPlayerStats(
266 StatRow->Character_Critical,
267 StatRow->Character_Critical_Dmg,
268 StatRow->Character_Life_Steal,
269 StatRow->Character_Knockback,
270 StatRow->Character_Soul_Gauge,
271 StatRow->Character_Soul_Gauge_Max,
272 StatRow->Character_Soul_Gauge_Cost
273 );
274}
Definition CK_PlayerState.h:16
FORCEINLINE class UPlayerAttributeSet * GetPlayerAttributeSet() const
Definition CK_PlayerState.h:23
void InitBaseStats(float InMaxHealth, float InMoveSpeed, float InAttack, float InAttackSpeed, float InStunDuration)
Definition BaseAttributeSet.cpp:21
Definition PlayerAttributeSet.h:11
void InitPlayerStats(float InCritical, float InCriticalDmg, float InLifeSteal, float InKnockback, float InSoulGauge, float InSoulGaugeMax, float InSoulGaugeCost)
Definition PlayerAttributeSet.cpp:17
Definition StatTable.h:12
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Move()

void ACK_CharacterPlayer::Move ( const FInputActionValue &  Value)
protected
183{
184 if (ASC && ASC->HasMatchingGameplayTag(TAG_CHARACTER_STATE_ISBLOCKMOVEMENT))
185 {
186 return;
187 }
188
189 FVector2D MovementVector = Value.Get<FVector2D>();
190
191 float InputSizeSquared = MovementVector.SquaredLength();
192 float MovementVectorSize;
193
194 if (InputSizeSquared > 1.0f)
195 {
196 MovementVector.Normalize();
197 MovementVectorSize = 1.0f;
198 }
199 else
200 {
201 MovementVectorSize = FMath::Sqrt(InputSizeSquared);
202 }
203
204 if (FollowCamera)
205 {
206 const FRotator CameraRotation = FollowCamera->GetComponentRotation();
207 const FRotator YawRotation(0, CameraRotation.Yaw, 0);
208
209 // 카메라 기준 앞/오른쪽 벡터 추출
210 const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
211 const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
212
213 // 최종 이동 적용
214 AddMovementInput(ForwardDirection, MovementVector.Y * MovementVectorSize);
215 AddMovementInput(RightDirection, MovementVector.X * MovementVectorSize);
216 }
217}

◆ OnDeath()

void ACK_CharacterPlayer::OnDeath ( )
protectedvirtual
220{
221 SetDead();
222}
virtual void SetDead() override
Definition CK_CharacterPlayer.cpp:224
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ PossessedBy()

void ACK_CharacterPlayer::PossessedBy ( AController *  NewController)
overrideprotectedvirtual
98{
99 Super::PossessedBy(NewController);
100
101 ACK_PlayerState* GASPS = GetPlayerState<ACK_PlayerState>();
102 if (GASPS)
103 {
105 ASC->InitAbilityActorInfo(GASPS, this);
106
108
109 for (const auto& StartAbility : CharacterControlData->StartAbilities)
110 {
111 FGameplayAbilitySpec StartSpec(StartAbility,1,INDEX_NONE, this);
112 ASC->GiveAbility(StartSpec);
113 }
114
116 {
117 for (const auto& StartInputAbility : PlayerExtendedData->StartInputAbilities)
118 {
119 FGameplayAbilitySpec StartSpec(StartInputAbility.Value,1, static_cast<int32>(StartInputAbility.Key),this);
120 ASC->GiveAbility(StartSpec);
121 }
122 }
123
124 if (const UPlayerAttributeSet* CurrentAttributeSet = ASC->GetSet<UPlayerAttributeSet>())
125 {
126 CurrentAttributeSet->OnDeathDelegate.AddDynamic(this, &ThisClass::OnDeath);
127 }
128 }
129}
virtual void InitializeAttributes() override
Definition CK_CharacterPlayer.cpp:233
virtual UAbilitySystemComponent * GetAbilitySystemComponent() const override
Definition CK_PlayerState.cpp:15
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ PostInitializeComponents()

void ACK_CharacterPlayer::PostInitializeComponents ( )
overrideprotectedvirtual
69{
70 Super::PostInitializeComponents();
71
73 {
75 }
76}
Definition CharacterControlData.h:25

◆ SetDead()

void ACK_CharacterPlayer::SetDead ( )
overrideprotectedvirtual

ACK_CharacterBase(으)로부터 재구현되었습니다.

225{
226 Super::SetDead();
227 if (APlayerController* PlayerController = Cast<APlayerController>(GetController()))
228 {
229 DisableInput(PlayerController);
230 }
231}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SetupPlayerInputComponent()

void ACK_CharacterPlayer::SetupPlayerInputComponent ( UInputComponent *  PlayerInputComponent)
overrideprotectedvirtual
132{
133 Super::SetupPlayerInputComponent(PlayerInputComponent);
134
136 {
137 return;
138 }
139
140 UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(PlayerInputComponent);
141
142 EnhancedInputComponent->BindAction(PlayerExtendedData->MoveAction, ETriggerEvent::Triggered, this, &ThisClass::Move);
143
144 EnhancedInputComponent->BindAction(PlayerExtendedData->DashAction, ETriggerEvent::Started, this, &ThisClass::GASInputPressed, static_cast<int32>(ECharacterInputID::Dash));
145 EnhancedInputComponent->BindAction(PlayerExtendedData->AttackAction, ETriggerEvent::Triggered, this, &ThisClass::GASInputPressed, static_cast<int32>(ECharacterInputID::Attack));
146 EnhancedInputComponent->BindAction(PlayerExtendedData->Q_SkillAction, ETriggerEvent::Triggered, this, &ThisClass::GASInputPressed, static_cast<int32>(ECharacterInputID::Q_Skill));
147 EnhancedInputComponent->BindAction(PlayerExtendedData->E_SkillAction, ETriggerEvent::Started, this, &ThisClass::GASInputPressed, static_cast<int32>(ECharacterInputID::E_Skill));
148}
TObjectPtr< UInputAction > AttackAction
Definition CharacterControlData.h:39
TObjectPtr< UInputAction > E_SkillAction
Definition CharacterControlData.h:45
TObjectPtr< UInputAction > DashAction
Definition CharacterControlData.h:33
TObjectPtr< UInputAction > MoveAction
Definition CharacterControlData.h:36
TObjectPtr< UInputAction > Q_SkillAction
Definition CharacterControlData.h:42

멤버 데이터 문서화

◆ CharacterControlData

TObjectPtr<UCharacterControlData> ACK_CharacterPlayer::CharacterControlData
protected

◆ FollowCamera

TObjectPtr<UCameraComponent> ACK_CharacterPlayer::FollowCamera
protected

◆ MotionWarpingComponent

TObjectPtr<UMotionWarpingComponent> ACK_CharacterPlayer::MotionWarpingComponent
protected

◆ PlayerExtendedData

const FPlayerExtendedData* ACK_CharacterPlayer::PlayerExtendedData = nullptr
protected

◆ SpringArm

TObjectPtr<USpringArmComponent> ACK_CharacterPlayer::SpringArm
protected

◆ WeaponMesh

TObjectPtr<UStaticMeshComponent> ACK_CharacterPlayer::WeaponMesh
protected

이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: