Unity 2d PONG 教程在代码部分有令人困惑的提及

Unity 2d PONG tutorial has confusing mention in code section

我正在按照本教程在 Unity 2d 中创建 PONG :-

http://unity.grogansoft.com/beginners-guide-create-pong-clone-in-unity-part-6/

大部分代码都看懂了,但这部分让我很困惑。我用粗体突出了令人困惑的部分。我在任何检查球名的代码示例中都看不到?我错过了什么?

代码:

void OnCollisionExit2D(Collision2D other)
{
    float adjust = 5 * direction;
    other.rigidbody.velocity = new Vector2(other.rigidbody.velocity.x, other.rigidbody.velocity.y + adjust);        
}

We make sure the item hitting the paddle is the ball by checking its name, then we apply a force to its rigidbody in the direction of the paddle’s movement. This also has the pleasant side effect of adding a little extra speed to the ball, making it faster and faster as the game goes on.

我认为你的想法是正确的:他们并不是真的"check the name"。但是,为了在没有真正完成本教程的情况下为您澄清,您引用的代码似乎是 "Paddle" class ("PaddleScript"?).

输入参数"other"是球——唯一可以击打球拍的物体。

所以,他们的文字有点误导。也许应该有另一个物体漂浮在周围。