【3Dゲームエンジン】Unity質問スレッド15 [転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0688名前は開発中のものです。
2015/02/17(火) 20:08:29.74ID:2swKsT4kどちらかの効果音をランダムに再生したいのですが、GetComponents の行で、
"BCE0044: unexpected char: 0x0."
というエラーでひっかかります。
なぜでしょうか??
***************************
var splash_snd01 : AudioSource;
var splash_snd02 : AudioSource;
var sndRandomNum : int;
var audioSource : AudioSource[] = GetComponents(AudioSource);
sndRandomNum = Random.Range(1,2);
if(sndRandomNum == 1)
{
splash_snd01.PlayOneShot(splash_snd01.clip);
}
else if(sndRandomNum == 2)
{
splash_snd02.PlayOneShot(splash_snd02.clip);
}
■ このスレッドは過去ログ倉庫に格納されています