【发布时间】:2015-05-12 22:28:57
【问题描述】:
我有一个脚本可以在玩家进入传送门时播放声音:
function OnTriggerEnter2D (other : Collider2D) {
if(other.name == "Blue Portal") {
audio.PlayOneShot(portalSound);
score.GetComponent(Score).scoreNumber += 1;
Debug.Log("LOL");
}
}
它不响应碰撞并且不显示 Debug.Log。我已经检查了门户的触发框。我尝试了一切,但它只是不工作。任何帮助将不胜感激。
【问题讨论】:
标签: unity3d scripting unityscript