KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UGameSoundManager.h
이 파일의 문서화 페이지로 가기
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
7#pragma once
8
9#include "CoreMinimal.h"
10#include "Macro.h"
11#include "EGameSoundType.h"
12#include "Subsystems/GameInstanceSubsystem.h"
13#include "UGameSoundManager.generated.h"
14
19UCLASS()
20class LATTELIBRARY_API UGameSoundManager : public UGameInstanceSubsystem
21{
22 GENERATED_BODY()
23
24public:
26
28
29 virtual void Initialize(FSubsystemCollectionBase& Collection) override;
30
31 UFUNCTION(BlueprintCallable, Category="Sound")
32 void PlaySound(EGameSoundType Type, FVector Location);
33
34 UFUNCTION(BlueprintCallable, Category="Sound")
35 void PlaySound2D(EGameSoundType Type);
36
37 UFUNCTION(BlueprintCallable, Category="Sound")
38 void StopSound2D(const EGameSoundType Type);
39
40 // 대화 음성 재생 (기존 대화 음성을 중지하고 새로운 음성 재생)
41 UFUNCTION(BlueprintCallable, Category="Sound")
42 UAudioComponent* PlayConversationVoice(USoundBase* Sound);
43
44 // 현재 재생 중인 대화 음성 중지
45 UFUNCTION(BlueprintCallable, Category="Sound")
46 void StopConversationVoice();
47
48 // 대화 음성이 재생 중인지 확인
49 UFUNCTION(BlueprintCallable, Category="Sound")
50 bool IsConversationVoicePlaying() const;
51
56 UFUNCTION(BlueprintCallable, Category="Sound")
57 void PlayBGM(EGameSoundType Type);
58
62 UFUNCTION(BlueprintCallable, Category="Sound")
63 void StopBGM();
64
65 EGameSoundType GetCurrentBGMType() const{ return CurrentBGMType;}
66
67private:
68 UPROPERTY(EditDefaultsOnly, Category = "Sound", meta = (AllowPrivateAccess = "true"))
69 TObjectPtr<class USoundData> SoundAsset;
70
71 UPROPERTY(EditAnywhere, Category = "Sound")
72 TMap<EGameSoundType, TObjectPtr<class USoundBase>> SoundData;
73
74 UPROPERTY()
75 TMap<EGameSoundType, UAudioComponent*> ActiveSounds;
76
77 // 현재 재생 중인 대화 음성 (MegaPopup, DasanExplain, PlayerAsk 공유)
78 UPROPERTY()
79 TObjectPtr<UAudioComponent> ConversationVoice;
80
81 // 현재 재생 중인 BGM
82 UPROPERTY()
83 TObjectPtr<UAudioComponent> CurrentBGM;
84
85 // 현재 재생 중인 BGM 타입
86 EGameSoundType CurrentBGMType;
87};
EGameSoundType 클래스를 선언합니다.
EGameSoundType
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
게임 내 모든 사운드 재생을 관리하는 중앙 사운드 관리 서브시스템입니다.
DEFINE_SUBSYSTEM_GETTER_INLINE(UGameSoundManager)