// Use this for initialization void Awake() { SoundManager.initSoundManager(am); ad1 = new AudioData(); ad1.addSound(ac1); ad1.addSound(ac2); ad1.addSound(ac3); SoundManager.getInstance().addAudioData("pewpew", ad1); ad2 = new AudioData(); ad2.addSound(ac4); SoundManager.getInstance().addAudioData("boom", ad2); ad3 = new AudioData(); ad3.addSound(ac5); SoundManager.getInstance().addAudioData("explo", ad3); ad4 = new AudioData(); ad4.addSound(ac6); SoundManager.getInstance().addAudioData("music", ad4); AudioSourcePerso asp = SoundManager.getInstance().getSound("music", Camera.main.gameObject.transform.position, 0.2f, "Music", true); asp.gameO.GetComponent<AudioSource>().Play(); }
public void addAudioData(String name, AudioData ad) { soundsList[name] = ad; }