public void StopAudio(string _nameStop) { SoundsStoringScript stopM = Array.Find(allSounds, sound => sound.name == _nameStop); stopM.aSource.Stop(); }
public void PlayAudio(string _nameStart) { SoundsStoringScript startM = Array.Find(allSounds, sound => sound.name == _nameStart); if (_nameStart == null) { Debug.LogWarning("Sound " + name + " NOT found !!!"); //useful if you want know on which Obj a Warning occurs return; } if (musicMuted == false) { startM.aSource.Play(); } }