Beispiel #1
0
 public override void Process()
 {
     base.Process();
     if (SignalManager.skipTransitions)
     {
         targetGap = Mathf.Lerp(0f, gap, input.value);
         ApplyTargetGap();
         leftJoint.ApplyXMotionTarget();
         rightJoint.ApplyXMotionTarget();
     }
 }
        protected override void SetJoint(float pos, float spring, float damper)
        {
            joint.targetPosition = -new Vector3(pos - (maxValue - minValue) / 2f, 0f, 0f);
            JointDrive xDrive = joint.xDrive;

            xDrive.positionSpring = spring;
            xDrive.positionDamper = damper;
            joint.xDrive          = xDrive;
            if (SignalManager.skipTransitions)
            {
                joint.ApplyXMotionTarget();
            }
            else
            {
                body.WakeUp();
            }
        }
Beispiel #3
0
 private void Snap(bool pressed)
 {
     if (showdebug)
     {
         Debug.Log(base.name + pressed);
     }
     if (activationMode == ButtonActivationMode.Touch)
     {
         slideJoint.targetPosition = new Vector3((!pressed) ? motionRange : (0f - motionRange), 0f, 0f);
     }
     if (slideJointRigidBody != null)
     {
         slideJointRigidBody.WakeUp();
     }
     bypassTimer = 0.1f;
     if (SignalManager.skipTransitions)
     {
         slideJoint.ApplyXMotionTarget();
     }
 }