RigidbodyKinematicLocker Class
Extends MonoBehaviour
Manages the kinematic state of a Rigidbody component attached to the GameObject.
This class provides methods to lock and unlock the kinematic state of the Rigidbody, ensuring controlled changes when multiple actors want to modify the kinematic state.
Locks to true the kinematic state of the attached Rigidbody.
This method increments an internal counter with each call and sets the Rigidbody to kinematic. It also saves the original kinematic state for restoration.
Unlocks the kinematic state of the attached Rigidbody.
This method decrements the internal counter. When the counter reaches zero, it restores the Rigidbody to its original kinematic state.