KLingo Project Documentation
1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UBasePopup.cpp
이 파일의 문서화 페이지로 가기
1
// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3
4
#include "
UBasePopup.h
"
5
#include "
UGameSoundManager.h
"
6
7
void
UBasePopup::NativeTick
(
const
FGeometry& MyGeometry,
float
InDeltaTime)
8
{
9
Super::NativeTick(MyGeometry, InDeltaTime);
10
11
if
(
bIsOpenAnim
)
12
{
13
UpdateAnimation
(InDeltaTime);
14
}
15
}
16
17
void
UBasePopup::OpenAnimation
()
18
{
19
if
(!IsInViewport())
20
{
21
AddToViewport();
22
}
23
24
// 팝업 오픈 사운드 재생 (None이 아닐 때만)
25
if
(
OpenAnimSound
!=
EGameSoundType::None
)
26
{
27
if
(
UGameSoundManager
* SoundManager = UGameSoundManager::Get(
this
))
28
{
29
SoundManager->PlaySound2D(
OpenAnimSound
);
30
}
31
}
32
33
// 블루프린트에서 정의한 애니메이션이 있으면 해당 애니메이션 재생
34
if
(
BlueprintOpenAnimation
)
35
{
36
PlayAnimation(
BlueprintOpenAnimation
);
37
return
;
38
}
39
40
// 블루프린트 애니메이션이 없으면 기본 스크립트 애니메이션 사용
41
SetRenderTransformPivot(
OpenPivot
);
42
SetRenderScale(FVector2D(
OpenStartScale
,
OpenStartScale
));
43
44
bIsOpenAnim
=
OpenDuration
> KINDA_SMALL_NUMBER;
45
OpenElapsedTime
= 0.0f;
46
47
if
(!
bIsOpenAnim
)
48
{
49
SetRenderScale(FVector2D(
OpenTargetScale
,
OpenTargetScale
));
50
}
51
}
52
53
void
UBasePopup::UpdateAnimation
(
float
InDeltaTime)
54
{
55
if
(!
bIsOpenAnim
)
56
{
57
return
;
58
}
59
60
OpenElapsedTime
+= InDeltaTime;
61
62
const
float
Alpha = FMath::Clamp(
OpenElapsedTime
/
OpenDuration
, 0.0f, 1.0f);
63
const
float
EasedAlpha =
FEaseHelper::Ease
(Alpha,
OpenEaseType
);
64
const
float
NewScale = FMath::Lerp(
OpenStartScale
,
OpenTargetScale
, EasedAlpha);
65
66
SetRenderScale(FVector2D(NewScale, NewScale));
67
68
if
(Alpha >= 1.0f)
69
{
70
bIsOpenAnim
=
false
;
71
}
72
}
EGameSoundType::None
@ None
UBasePopup.h
UGameSoundManager.h
UGameSoundManager 클래스를 선언합니다.
UBasePopup::OpenAnimSound
EGameSoundType OpenAnimSound
팝업 오픈 시 재생될 사운드 타입
Definition
UBasePopup.h:96
UBasePopup::OpenAnimation
void OpenAnimation()
팝업 오픈 애니메이션을 재생합니다
Definition
UBasePopup.cpp:17
UBasePopup::OpenDuration
float OpenDuration
애니메이션 지속 시간
Definition
UBasePopup.h:64
UBasePopup::OpenElapsedTime
float OpenElapsedTime
경과 시간
Definition
UBasePopup.h:60
UBasePopup::NativeTick
virtual void NativeTick(const FGeometry &MyGeometry, float InDeltaTime) override
Definition
UBasePopup.cpp:7
UBasePopup::bIsOpenAnim
bool bIsOpenAnim
애니메이션 재생 중 여부
Definition
UBasePopup.h:57
UBasePopup::UpdateAnimation
void UpdateAnimation(float InDeltaTime)
스크립트 오픈 애니메이션 업데이트
Definition
UBasePopup.cpp:53
UBasePopup::OpenStartScale
float OpenStartScale
시작 스케일
Definition
UBasePopup.h:68
UBasePopup::OpenPivot
FVector2D OpenPivot
애니메이션 중심점 (0~1 범위)
Definition
UBasePopup.h:76
UBasePopup::OpenEaseType
EEaseType OpenEaseType
Easing 타입
Definition
UBasePopup.h:83
UBasePopup::OpenTargetScale
float OpenTargetScale
목표 스케일
Definition
UBasePopup.h:72
UBasePopup::BlueprintOpenAnimation
UWidgetAnimation * BlueprintOpenAnimation
블루프린트에서 정의한 오픈 애니메이션
Definition
UBasePopup.h:45
UGameSoundManager
게임 내 모든 사운드 재생을 관리하는 중앙 사운드 관리 서브시스템입니다.
Definition
UGameSoundManager.h:21
FEaseHelper::Ease
static float Ease(float Alpha, EEaseType Type)
Definition
FEaseHelper.h:45
Source
Onepiece
MessageBox
Private
UBasePopup.cpp
생성시간 : 금 1월 9 2026 00:25:57, 프로젝트명 : KLingo Project Documentation, 생성자 :
1.9.8