ย
๋ฌธ์ ์ ํ์
์ค๋์ค ์์คํ
์ ๊ตฌํํ๋๋ฐ ๊ฐ์ฅ ๊ฑธ๋ฆผ๋์ด ๋๋๊ฑด Level์ด ๋ฐ๋ ๋๋ง๋ค ์์
์ ๊ฐ์ ์ ์ผ๋ก ๋์ด์ผ ํ๋ค๋ ๊ฒ์
๋๋ค. ์ด๊ฑธ ํด๊ฒฐํ๊ธฐ ์ํด ์ฑ๊ธํค ํจํด ๊ธฐ๋ฐ ์์์ฑ์ ๊ฐ์ง๋ ์ ์ญ Scope๋ฅผ ํตํด ์ ๊ทผํ๋ ๋ฐฉ์์ผ๋ก ์ค๊ณ ๋ฐฉํฅ์ ์ก์์ต๋๋ค.
Project Settings > Maps & Modes > Game Instance > Game Instance Class์ ์ด๋ฏธ BP_GI๊ฐ ์ฐจ์งํ๊ณ ์๋ค๋๊ฑธ ํ์
ํ์ผ๋ฉฐ, ์์
์์คํ
์ BP_GI ์์์ ๊ตฌํํ๋๊ฑด BP_GI๊ฐ ๋น๋ํด์ ธ ๋ฒ๋ฆฌ๊ธฐ์ ๋ชจ๋ํ๋ฅผ ํ์ฌ ๋ถ๋ฆฌํ๋๊ฒ์ด ์ ํฉํ๋ค๊ณ ๊ฒฐ์ ํ์ต๋๋ค.๋ํ ๋ชจ๋ํ๋ก ์ธํ ๋ถ์์ ์ธ ํจ๊ณผ๋ก ๋จ์ผ ์ฑ
์ ์์น๊ณผ ๊ด์ฌ์ฌ ๋ถ๋ฆฌ๊ฐ ๋ฐ๋ผ์ค๋๊ฒ์ ๊ธฐ๋ํ ์ ์๋ค๊ณ ์๊ฐํ์ต๋๋ค.
๋ฐ๋ผ์ ์์๊ฐ์ ์ด์ ๋ก Game Instance Subsystem์ ๋ง๋ค๊ธฐ๋ก ๊ฒฐ์ ํ์์ผ๋ฉฐ, ์ค๋ก์ง ์ด ๊ฒ์์ Audio System๋ง์ ์ํ ํด๋์ค๊ฐ ๋ ๊ฒ์
๋๋ค.

ํด๊ฒฐ๋ฐฉ์
Game Instance Subsystem ํด๋์ค ์์ฑ ํ, UCLASS ๊ดํธ์์ Abstract๋ฅผ ์ถ๊ฐํ์ฌ ์ถํ ์ฑ๊ธํค ํจํด์ด ๋ถ๊ดด๋์ง ์๊ฒ๋ ๋ง๋ค์์ผ๋ฉฐ, Blueprintable์ ์ถ๊ฐํ์ฌ ๋ธ๋ฃจํ๋ฆฐํธ ์์ ํด๋์ค๋ฅผ ๋ง๋ค ์ ์๊ฒ ์ค์ ํด๋์์ต๋๋ค.
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Subsystems/GameInstanceSubsystem.h" #include "CropoutAudioSubsystem.generated.h" /** * */ UCLASS(Abstract, Blueprintable) class CROPOUTSAMPLEPROJECT_API UCropoutAudioSubsystem : public UGameInstanceSubsystem { GENERATED_BODY() };
ย
์ดํ @/Content/Audio/Core/Blueprints์ CropoutAudioSubsystem Class๋ฅผ ์ฐธ์กฐํ๋ BPS_AudioCore๋ฅผ ๋ฏธ๋ฆฌ ์์ฑํ์์ผ๋ฉฐ, Play_Sound๋ผ๋ Custom Event๋ ๋จผ์ ๋ง๋ค์ด ์ฃผ์์ต๋๋ค.
Play_Sound Custom Event๋ ์๋ฆฌ๊ฐ ๋์ผ ํ ๋ชจ๋ ๊ณณ์์ ํธ์ถ๋ ์์ ์ด๋ฉฐ ๋๊ธฐ, ๋น๋๊ธฐ์ UI, Music, Ambience, SFX ๊ตฌ๋ถ ํ ์ฌ์ฉ๋ Play Sound 2D์ Play Sound at Location์ Data Driven ๋ฐฉ์์ผ๋ก ํต์ ํ๋๋ก ๋ง๋ค ์์ ์
๋๋ค.

