Commit eb93066b authored by mercury233's avatar mercury233

Revert "Fixed an issue that caused the audio to not play in folders with specific characters."

This reverts commit 9e36fb05.
parent b65f74e2
...@@ -963,7 +963,7 @@ public static class UIHelper ...@@ -963,7 +963,7 @@ public static class UIHelper
return; return;
} }
path = Environment.CurrentDirectory.Replace("\\", "/") + "/" + path; path = Environment.CurrentDirectory.Replace("\\", "/") + "/" + path;
path = new Uri(new Uri("file:///"), path).AbsolutePath; path = "file:///" + path;
GameObject audio_helper = Program.I().ocgcore.create_s(Program.I().mod_audio_effect); GameObject audio_helper = Program.I().ocgcore.create_s(Program.I().mod_audio_effect);
audio_helper.GetComponent<audio_helper>().play(path, Program.I().setting.soundValue()); audio_helper.GetComponent<audio_helper>().play(path, Program.I().setting.soundValue());
Program.I().destroy(audio_helper,5f); Program.I().destroy(audio_helper,5f);
......
...@@ -17,25 +17,23 @@ public class audio_helper : MonoBehaviour { ...@@ -17,25 +17,23 @@ public class audio_helper : MonoBehaviour {
} }
} }
bool played = false; bool played = false;
private IEnumerator playSound(string u,float vol) public void play(string u,float vol)
{ {
played = false; played = false;
using (WWW www = new WWW(u)) WWW www = new WWW(u);
{
yield return www; AudioClip ac = www.GetAudioClip(true, true);
AudioClip ac = www.GetAudioClip(true, true); audioMgr.clip = ac;
audioMgr.clip = ac;
}
audioMgr.volume = vol; audioMgr.volume = vol;
} }
public void play(string u,float vol)
{
StartCoroutine(playSound(u, vol));
}
public void change_bgm(string str) public void change_bgm(string str)
{ {
StartCoroutine(playSound(str, 100f)); played = false;
WWW www = new WWW(str);
AudioClip ac = www.GetAudioClip(true, true);
audioMgr.clip = ac;
audioMgr.loop = true; audioMgr.loop = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment