KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
ULoadginCircle.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
8#include "ULoadginCircle.h"
9
10#include "GameLogging.h"
11
12
13#include "Blueprint/WidgetTree.h"
14#include "Components/HorizontalBoxSlot.h"
15#include "Components/Image.h"
16#include "Components/Overlay.h"
17#include "Engine/GameViewportClient.h"
18#include "Engine/World.h"
19#include "HAL/CriticalSection.h"
20#include "Misc/DateTime.h"
21#include "Misc/ScopeLock.h"
22#include "TimerManager.h"
23
25{
26 Super::NativeConstruct();
27
28 UpdateVisibility(false);
29}
30
31void ULoadginCircle::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
32{
33 Super::NativeTick(MyGeometry, InDeltaTime);
34
35 UpdateLoadingSpinner(InDeltaTime);
36}
37
39{
40 UpdateVisibility(true);
41}
42
44{
45 UpdateVisibility(false);
46}
47
49{
50 if (!LoadingSpinner || !LoadingSpinner->IsVisible())
51 return;
52
53 const float NewAngle = LoadingSpinner->GetRenderTransformAngle() + (SpinnerRotationSpeed * DeltaTime);
54 LoadingSpinner->SetRenderTransformAngle(NewAngle);
55}
56
58{
59 if (!RootOverlay)
60 {
61 return;
62 }
63
64 if (bShouldShow)
65 {
66 // 로딩 중일 때: 보이고, 터치 차단
67 SetVisibility(ESlateVisibility::Visible);
68 RootOverlay->SetVisibility(ESlateVisibility::Visible);
69 }
70 else
71 {
72 // 로딩 완료 시: 안 보이지만 Hit Test 완전히 무시 (터치 이벤트 통과)
73 SetVisibility(ESlateVisibility::HitTestInvisible);
74 RootOverlay->SetVisibility(ESlateVisibility::Collapsed);
75 }
76}
77
79{
80 if (UWorld* World = GetWorld())
81 {
82 if (UGameViewportClient* ViewportClient = World->GetGameViewport())
83 {
84 if (IsInViewport())
85 RemoveFromParent();
86
87 AddToViewport(ZOrder);
88 }
89 }
90}
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
ULoadginCircle 클래스를 선언합니다.
class UImage * LoadingSpinner
네트워크 대기 상태를 나타내는 로딩 스피너 이미지입니다.
float SpinnerRotationSpeed
로딩 스피너의 회전 속도(초당 각도)입니다.
void UpdateLoadingSpinner(float DeltaTime)
로딩 스피너 회전 애니메이션을 갱신합니다.
class UOverlay * RootOverlay
로딩 중 전체 화면을 덮는 오버레이입니다.
void UpdateVisibility(bool bShouldShow)
위젯 가시성을 업데이트합니다.
void Show()
로딩 서클을 표시합니다.
virtual void NativeConstruct() override
위젯 생성 시 초기화 작업을 수행합니다.
void AddToGameViewport(int32 ZOrder)
위젯을 Game Viewport에 추가하여 레벨 전환 시에도 유지되도록 합니다.
void Hide()
로딩 서클을 숨깁니다.
virtual void NativeTick(const FGeometry &MyGeometry, float InDeltaTime) override
매 프레임 상태 표시를 갱신합니다.