Example #1
0
    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());
    }
Example #2
0
 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);
 }