// Use this for initialization void Start() { if (new System.Random().Next(1, 3) == 1) { WavPlayer.PlayWavSound(Application.streamingAssetsPath + "/VoicePackets/远山/远山_交谈1.wav"); } else { WavPlayer.PlayWavSound(Application.streamingAssetsPath + "/远山_标题.wav"); } //print(Application.dataPath+ @"/StreamingAssets/VoicePackets/远山/远山_交谈1.wav"); //Debug.LogWarning("ShowTitle123123123"); }
void MouseDown() { //print(Application.streamingAssetsPath + "/VoicePackets/远山/远山_" + tmp.ElementAt(i) + ".wav"); //Debug.LogWarning(Application.streamingAssetsPath + "/VoicePackets/远山/远山_" + tmp.ElementAt(i) + ".wav"); //if (File.Exists(Application.streamingAssetsPath + "/VoicePackets/远山/远山_" + tmp.ElementAt(i) + ".wav")) //WavPlayer.PlayWavSound(Application.streamingAssetsPath + "/VoicePackets/远山/远山_" + tmp.ElementAt(i) + ".wav"); //else // print("无此音频文件!"); int len = list.Count(); int pos = new System.Random().Next(0, len); string str = (list.ElementAt(pos))[0]; string text = (list.ElementAt(pos))[1]; string filepath = Application.streamingAssetsPath + "/VoicePackets/远山/远山_" + str + ".wav"; if (File.Exists(filepath)) { WavPlayer.PlayWavSound(filepath); TextTest.text = text; countnum = 0; } //WavPlayer.PlayWavSound(Application.streamingAssetsPath + "/VoicePackets/远山/远山_问候.wav"); }