using DarkTonic.MasterAudio; using System; using UnityEngine; public class BgmConfig : MonoBehaviour { public string playlistName = "Bgm"; // Ç÷¹ÀÌ ¸®½ºÆ®ÀÇ À̸§À» ¼³Á¤ÇÕ´Ï´Ù. private static BgmConfig instance; public static BgmConfig Instance { get { if (instance == null) { instance = FindObjectOfType(); if (instance == null) { GameObject obj = new GameObject("BgmConfig"); instance = obj.AddComponent(); } } return instance; } } private void Start() { // BGMÀ» Àç»ýÇÕ´Ï´Ù. MasterAudio.StartPlaylist(playlistName); } private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); } }