void Start() { velocityTracker = new Vector3Tracker((v) => rigidbody.velocity = v, () => rigidbody.velocity); angularVelocityTracker = new Vector3Tracker((v) => rigidbody.angularVelocity = v, () => rigidbody.angularVelocity); isKinematicTracker = new BoolTracker((v) => rigidbody.isKinematic = v, () => rigidbody.isKinematic); // new BoolTracker((v) => { // if (v) { // rigidbody.Sleep(); // } else { // rigidbody.WakeUp(); // } // }, () => rigidbody.IsSleeping()); }
void Start() { velocityTracker = new Vector3Tracker((v) => rigidbody.velocity = v, () => rigidbody.velocity); angularVelocityTracker = new Vector3Tracker((v) => rigidbody.angularVelocity = v, () => rigidbody.angularVelocity); isKinematicTracker = new BoolTracker((v) => rigidbody.isKinematic = v, () => rigidbody.isKinematic); }