public Transform groundCheckTransform;  //自己
public float groundCheckRadius = 0.2f;//距离
public LayerMask groundMask;//目标的layer

 

//检测是否在地板上
isGround = Physics.CheckSphere(groundCheckTransform.position,groundCheckRadius, groundMask, QueryTriggerInteraction.Ignore);