public void Play(string name) { Sounds.Sound s = Array.Find(sounds, sound => sound.name == name); if (s == null) { return; } s.source.Play(); }
/// <summary>Loads a sound and returns the sound data.</summary> /// <param name="path">The path to the file or folder that contains the sound.</param> /// <param name="sound">Receives the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public virtual bool LoadSound(string path, out Sounds.Sound sound) { sound = null; return(false); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="sound">The sound data.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public virtual bool RegisterSound(Sounds.Sound sound, out SoundHandle handle) { handle = null; return(false); }