Beispiel #1
0
        public void ApplyJointSettings(float _anchorOffset)
        {
            this.joint = (ConfigurableJoint)this.gameObject.GetComponent <ConfigurableJoint>();
            if (Object.op_Equality((Object)this.joint, (Object)null))
            {
                this.joint = (ConfigurableJoint)this.gameObject.AddComponent <ConfigurableJoint>();
            }
            this.joint.set_xMotion((ConfigurableJointMotion)1);
            this.joint.set_yMotion((ConfigurableJointMotion)1);
            this.joint.set_zMotion((ConfigurableJointMotion)1);
            ConfigurableJoint joint1          = this.joint;
            SoftJointLimit    softJointLimit1 = (SoftJointLimit)null;

            ((SoftJointLimit) ref softJointLimit1).set_limit(this.jointSettings.swingLimit);
            SoftJointLimit softJointLimit2 = softJointLimit1;

            joint1.set_linearLimit(softJointLimit2);
            ConfigurableJoint    joint2            = this.joint;
            SoftJointLimitSpring jointLimitSpring1 = (SoftJointLimitSpring)null;

            ((SoftJointLimitSpring) ref jointLimitSpring1).set_spring(this.jointSettings.spring);
            ((SoftJointLimitSpring) ref jointLimitSpring1).set_damper(this.jointSettings.damper);
            SoftJointLimitSpring jointLimitSpring2 = jointLimitSpring1;

            joint2.set_linearLimitSpring(jointLimitSpring2);
        }