using System.Collections.Generic;
public class ScriptSample03_SoundManager : MonoBehaviour {
static private bool isAwaked = false;
public string cueSheetName = "CueSheet_0";
private List<string> cueNameList = new List<string> ();
private CriAtomSource atomSourceMusic;
static private ScriptSample03_SoundManager instance = null;
void Awake ()
{
if (isAwaked) {
GameObject.Destroy(this);
return;
}
isAwaked = true;
CriAtomExAcb acb = CriAtom.GetAcb (cueSheetName);
CriAtomEx.CueInfo[] cueInfoList = acb.GetCueInfoList ();
foreach (CriAtomEx.CueInfo cueInfo in cueInfoList) {
cueNameList.Add (cueInfo.name);
}
atomSourceMusic = gameObject.AddComponent<CriAtomSource> ();
atomSourceMusic.cueSheet = cueSheetName;
GameObject.DontDestroyOnLoad(this.gameObject);
instance = this;
}
static public void PlayCueId(int cueId){
instance.atomSourceMusic.Play(cueId);
}
}