2
好了,所以我得到這個代碼,我縮小到一個行:如何正確使用getComponants來獲取音頻數組?
gameObject.GetComponents(AudioSource)[0].audio.Play();
這一行給了我這個錯誤:
InvalidCastException: Cannot cast from source type to destination type.
scriptexplosion+$Start$4+$.MoveNext() (at Assets/scriptexplosion.js:7)
我的問題是我怎麼把組件的陣列成AudioSource數組?
那一個給了我這個:Assets/scriptexplosion.js(7,34):BCE0048:類型'System.Type'不支持切片。 雖然這是個好主意。 – CyanPrime 2013-03-27 05:32:09