123456789101112131415161718192021222324252627282930313233343536 |
- 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<BackgroundSound>();
- _effectSound = (GameObject.Instantiate(Resources.Load("Prefabs/Sounds/EffectSound")) as GameObject)
- .GetComponent<EffectSound>();
- }
- private static SoundManager instance;
- public static SoundManager GetInstatnce()
- {
- if(instance == null)
- {
- instance = new SoundManager();
- }
- return instance;
- }
- }
|