mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Fix Importing Music files on Linux (#89)
* fix importing music files on linux * oops
This commit is contained in:
parent
6b70f7c342
commit
9b9bfea627
1 changed files with 17 additions and 2 deletions
|
@ -224,6 +224,7 @@ namespace HeavenStudio.Editor
|
||||||
new ExtensionFilter("Music Files", "mp3", "ogg", "wav")
|
new ExtensionFilter("Music Files", "mp3", "ogg", "wav")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if UNITY_STANDALONE_WINDOWS
|
||||||
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", extensions, false, async (string[] paths) =>
|
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", extensions, false, async (string[] paths) =>
|
||||||
{
|
{
|
||||||
if (paths.Length > 0)
|
if (paths.Length > 0)
|
||||||
|
@ -235,6 +236,19 @@ namespace HeavenStudio.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", extensions, false, async (string[] paths) =>
|
||||||
|
{
|
||||||
|
if (paths.Length > 0)
|
||||||
|
{
|
||||||
|
Conductor.instance.musicSource.clip = await LoadClip("file://" + Path.Combine(paths));
|
||||||
|
changedMusic = true;
|
||||||
|
|
||||||
|
Timeline.FitToSong();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<AudioClip> LoadClip(string path)
|
private async Task<AudioClip> LoadClip(string path)
|
||||||
|
@ -343,6 +357,7 @@ namespace HeavenStudio.Editor
|
||||||
Timeline.instance.TempoInfo.UpdateStartingBPMText();
|
Timeline.instance.TempoInfo.UpdateStartingBPMText();
|
||||||
Timeline.instance.VolumeInfo.UpdateStartingVolumeText();
|
Timeline.instance.VolumeInfo.UpdateStartingVolumeText();
|
||||||
Timeline.instance.TempoInfo.UpdateOffsetText();
|
Timeline.instance.TempoInfo.UpdateOffsetText();
|
||||||
|
Timeline.FitToSong();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenRemix()
|
public void OpenRemix()
|
||||||
|
|
Loading…
Reference in a new issue