【发布时间】:2013-03-17 03:42:45
【问题描述】:
好的,所以我把这段代码压缩到了一行:
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 数组?
【问题讨论】:
标签: audio unity3d unityscript