コード例 #1
0
 /// <summary>
 /// Sets the volume of a sound.
 /// </summary>
 /// <param name="sound">The sound.</param>
 /// <param name="volume">The new volume.</param>
 /// <returns>True if successful; false otherwise.</returns>
 public static bool SetVolume(SoundContainer sound, float volume)
 {
     if (sound.HasSound)
     {
         return(SetVolume(sound.AudioInfo, volume));
     }
     return(false);
 }
コード例 #2
0
 /// <summary>
 /// Sets the audio info to the data of a sound pack file audio.
 /// </summary>
 /// <param name="sound">The sound.</param>
 /// <param name="spfAudio">The sound pack file audio.</param>
 /// <returns>True if successful; false otherwise.</returns>
 public static bool SetAudioInfo(SoundContainer sound, SoundPacksFileV1.Audio spfAudio)
 {
     if (sound.HasSound)
     {
         return(SetAudioInfo(sound.AudioInfo, spfAudio));
     }
     return(false);
 }
コード例 #3
0
 /// <summary>
 /// Gets the volume of a sound.
 /// </summary>
 /// <param name="sound">The sound.</param>
 /// <returns>The volume of the sound if it has one; otherwise null.</returns>
 public static float?GetVolume(SoundContainer sound)
 {
     if (sound.HasSound)
     {
         return(GetVolume(sound.AudioInfo));
     }
     return(null);
 }
コード例 #4
0
 /// <summary>
 /// Gets the sound pack file audio from an audio info.
 /// </summary>
 /// <param name="sound">The sound.</param>
 /// <returns>The sound pack file audio.</returns>
 public static SoundPacksFileV1.Audio GetAudioInfo(SoundContainer sound)
 {
     if (sound.HasSound)
     {
         return(GetAudioInfo(sound.AudioInfo));
     }
     return(null);
 }