📅  最后修改于: 2022-03-11 14:48:59.405000             🧑  作者: Mango
//This is for Unity (c#)
Rigidbody rb; //For 2D games use 'Rigidbody2D'
void Awake ()
{
rb = GetComponent();
}
// (...)
rb.bodyType = RigidbodyType2D.Static; // Deactivated
rb.bodyType = RigidbodyType2D./*The type the rigidbody was originally eg. dynamic, kinematic, or static*/; // Activated