Ejemplo n.º 1
0
 public void PlaySound()
 {
     using (var player = new SoundPlayer(SoundLibrary.GetSoundName()))
     {
         player.PlaySync();
     }
     _thread.Join();
 }
Ejemplo n.º 2
0
 public void Play()
 {
     if (_audioSource.isPlaying)
     {
         return;
     }
     _audioSource.clip = SoundLibrary.GetSoundClip();
     _audioSource.loop = true;
     _audioSource.Play();
 }
Ejemplo n.º 3
0
 private void OnEnable()
 {
     _list = new ReorderableList(SoundLibrary.GetAllSoundFileNames().ToList(), typeof(string), false, true, false, false);
     _list.drawHeaderCallback += (Rect r) =>
     {
         EditorGUI.LabelField(r, "Sound Files");
     };
     _list.drawElementCallback = (rect, index, isActive, isFocus) =>
     {
         if (isFocus)
         {
             ElevatorSettings.DefaultTrackIndex = index;
         }
         EditorGUI.LabelField(rect, SoundLibrary.GetAllSoundFileNames()[index]);
     };
 }
Ejemplo n.º 4
0
 public void Play()
 {
     SoundLibrary.GetSoundName();
     _thread = new Thread(PlaySound);
     _thread.Start();
 }