private IEnumerator SetAudioClip(FolderHotkeyMappingInternal mapping) { mapping.UiSoundClip = m_defaultUiSound; if (!System.IO.File.Exists(mapping.UiSoundPath)) { Debug.LogError($"Attempted to load nonexistent sound file: {mapping.UiSoundPath}"); yield break; } using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(mapping.UiSoundPath, AudioType.WAV)) { yield return(www.Send()); if (www.isNetworkError) { Debug.LogError(www.error); Debug.LogError($"Attempted to load invalid/corrupt sound file: {mapping.UiSoundPath}"); } else { mapping.UiSoundClip = DownloadHandlerAudioClip.GetContent(www); } } }
private void MoveCurrentSong(FolderHotkeyMappingInternal folderMapping) { if (m_isImporting || !m_songPlayer.IsPlaying) { m_statusText.text = "[ SYSTEM ] Cannot move song while it is still loading!"; return; } m_songPlayer.StopPlayback(); StartCoroutine(TryMoveFile(m_currentFilePath, folderMapping.AbsoluteFolderPath + "\\" + Path.GetFileName(m_currentFilePath))); m_statusText.text = $"[ SYSTEM ] Moved {Path.GetFileName(m_currentFilePath)} to {new DirectoryInfo(folderMapping.AbsoluteFolderPath).Name}"; Debug.Log($"Moved {Path.GetFileName(m_currentFilePath)} to {new DirectoryInfo(folderMapping.AbsoluteFolderPath).Name}"); if (folderMapping.UiSoundClip) { m_uiSound.clip = folderMapping.UiSoundClip; } else { m_uiSound.clip = m_defaultUiSound; } m_uiSound.Play(); InitializeNextSong(); }