📜  如何禁用和启用刚体统一 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:59.405000             🧑  作者: Mango

代码示例2
//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