using UnityEngine; using System.Collections; public class SoundManager { private BackgroundSound _bgSound; public BackgroundSound bgSound { get{return _bgSound;} } private EffectSound _effectSound; public EffectSound effectSound { get{return _effectSound;} } public SoundManager() { _bgSound = (GameObject.Instantiate(Resources.Load("Prefabs/Sounds/BackgroundSound")) as GameObject) .GetComponent(); _effectSound = (GameObject.Instantiate(Resources.Load("Prefabs/Sounds/EffectSound")) as GameObject) .GetComponent(); } private static SoundManager instance; public static SoundManager GetInstatnce() { if(instance == null) { instance = new SoundManager(); } return instance; } }