Hi everybody, in my project I have this code:
private void SelectFolderAndGenerateDatabase()
{
selectedFolderPath = UnityEditor.EditorUtility.OpenFolderPanel("Seleziona Cartella", "", "");
if (!string.IsNullOrEmpty(selectedFolderPath))
{
audioFilesInfo.Clear();
string[] mp3Files = Directory.GetFiles(selectedFolderPath, "*.mp3", SearchOption.AllDirectories);
foreach (string filePath in mp3Files)
{
TagLib.File tagFile = TagLib.File.Create(filePath);
AudioFileInfo fileInfo = new AudioFileInfo();
fileInfo.artist = tagFile.Tag.FirstPerformer;
fileInfo.title = tagFile.Tag.Title;
fileInfo.album = tagFile.Tag.Album;
fileInfo.genre = tagFile.Tag.FirstGenre;
fileInfo.year = (uint)tagFile.Tag.Year;
fileInfo.duration = tagFile.Properties.Duration.ToString();
fileInfo.filePath = filePath;
fileInfo.played = false;
}
In unity editor I’m opening the folder to select without problems, but when I build my project for windows this is not working.
Could anyone please help me ?
I know I can’t user “EditorUtility” in build but I don’t know any solution for windows.
Thanks in advance