团结:精灵不会死在我的仙人掌上。为什么?

Unity: the sprite won't die on my cactus. Why?

所以,当西装中的精灵与仙人掌相撞时,我希望游戏进入第 2 级。

为什么这行不通?此代码附在仙人掌上。

function OnTriggerEnter2D(collider : Collider2D) {
    Application.LoadLevel(2);
}

尝试 OnTriggerEnter2D ,并将此函数放在仙人掌中。