public void Play(string name) { T10_Sound s = Array.Find(sounds, sound => sound.name == name); if (s == null) { Debug.LogWarning("Sound : " + name + "not found!"); return; } s.source.volume = s.volume; s.source.Play(); }
public void StopPlaying(string sound) { T10_Sound s = Array.Find(sounds, item => item.name == sound); if (s == null) { Debug.LogWarning("Sound: " + name + " not found!"); return; } s.source.volume = s.volume; s.source.pitch = s.pitch; s.source.Stop(); }