// If on the ground and jump is pressed...
if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump) { // ... add force in upwards. m_Rigidbody.AddForce(Vector3.up*m_JumpPower, ForceMode.Impulse); }本文共 221 字,大约阅读时间需要 1 分钟。
// If on the ground and jump is pressed...
if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump) { // ... add force in upwards. m_Rigidbody.AddForce(Vector3.up*m_JumpPower, ForceMode.Impulse); }转载地址:http://xualo.baihongyu.com/