help to understand Scripting

how dose Rigidbody.Sleep() and Rigidbody.IsSleeping() work.What dose it mean?

Documentation is a good thing.

Sleeping

Once a rigidbody is moving at less than a certain minimum linear or rotational speed, the physics engine will assume it has come to a halt. When this happens, the object will not move again until it receives a collision or force and so it will be set to “sleeping” mode. This optimisation means that no processor time will be spent updating the rigidbody until the next time it is “awoken” (ie, set in motion again). For most purposes, the sleeping and waking of rigidbodies happens transparently. However, an object might fail to wake up if a static collider (ie, one without a rigidbody) is moved into it or away from it by modifying the transform position. This might result, say, in the rigidbody object hanging in the air when the floor has been moved out from beneath it. In cases like this, the object can be woken explicitly using the WakeUp function. See the Rigidbody and Rigidbody 2D component pages for more information about sleeping.

http://docs.unity3d.com/Manual/RigidbodiesOverview.html


RigidBody.Sleep()

Forces a rigidbody to sleep at least one frame.

A common use is to call this from Awake in order to make a rigidbody sleep at startup. See the Rigidbodies Overview in the manual for more information about Rigidbody sleeping.

https://docs.unity3d.com/ScriptReference/Rigidbody.Sleep.html


RigidBody.IsSleeping()

Is the rigidbody sleeping? Returns a bool, true if it’s sleeping.

https://docs.unity3d.com/ScriptReference/Rigidbody.IsSleeping.html


More RigidBody resources:

https://docs.unity3d.com/ScriptReference/Rigidbody.html

https://unity3d.com/learn/tutorials/topics/physics/rigidbodies