public void PlaySound() { using (var player = new SoundPlayer(SoundLibrary.GetSoundName())) { player.PlaySync(); } _thread.Join(); }
public void Play() { if (_audioSource.isPlaying) { return; } _audioSource.clip = SoundLibrary.GetSoundClip(); _audioSource.loop = true; _audioSource.Play(); }
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]); }; }
public void Play() { SoundLibrary.GetSoundName(); _thread = new Thread(PlaySound); _thread.Start(); }