Play() 공개 메소드

public Play ( float volume, bool loopPlayback ) : void
volume float
loopPlayback bool
리턴 void
예제 #1
0
 public static void Play(string filename, Priority priority)
 {
     if (filename != null && filename != "")
     {
         SoundClip newSound;
         switch (priority)
         {
             case Priority.High:
                 newSound = new SoundClip(GameRef.Content, filename);
                 HighPrioritySounds.Add(newSound);
                 newSound.Play(volume, false);
                 break;
             case Priority.Normal:
                 if (NormalSounds.Count < MaxNormalSounds)
                 {
                     newSound = new SoundClip(GameRef.Content, filename);
                     NormalSounds.Add(newSound);
                     newSound.Play(volume, false);
                 }
                 break;
             case Priority.WindNoise:
                 newSound = new SoundClip(GameRef.Content, filename);
                 WindNoise = newSound;
                 newSound.Play(volume, true);
                 break;
         }
     }
     Update();
 }
예제 #2
0
파일: MusicTrack.cs 프로젝트: AnyKey/tojam4
        public void Play(int trackindex, bool LoopTrack)
        {
            if (currentClip != null)
            {
                Stop();
            }

            currentClip = clips[trackindex];
            currentClip.Play(Volume, LoopTrack);
        }