让小球跳起来

// 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);
}

posted on 2017-06-26 09:36  jiahuafu  阅读(270)  评论(0编辑  收藏  举报

导航