示例#1
0
 // Token: 0x0600013A RID: 314 RVA: 0x0000CFB8 File Offset: 0x0000B1B8
 private void SetJointConstraint(RagdollBodyElements.Joint jointName, RagdollBodyElements.Joint connectedJoint, bool enableCollision, Vector4 limits)
 {
     this.jointCJ = this.bodyElements.GetJoint(jointName).AddComponent <ConfigurableJoint>();
     this.jointCJ.connectedBody                = this.bodyElements.GetJoint(connectedJoint).GetComponent <Rigidbody>();
     this.jointCJ.enableCollision              = enableCollision;
     this.jointLimit.limit                     = limits.x;
     this.jointCJ.lowAngularXLimit             = this.jointLimit;
     this.jointLimit.limit                     = limits.y;
     this.jointCJ.highAngularXLimit            = this.jointLimit;
     this.jointLimit.limit                     = limits.z;
     this.jointCJ.angularYLimit                = this.jointLimit;
     this.jointLimit.limit                     = limits.w;
     this.jointCJ.angularZLimit                = this.jointLimit;
     this.jointLimitSpring.spring              = this.linearSpring;
     this.jointLimitSpring.damper              = this.linearDamp;
     this.jointCJ.linearLimitSpring            = this.jointLimitSpring;
     this.jointLimitSpring.spring              = this.angularSpring;
     this.jointLimitSpring.damper              = this.angularDamp;
     this.jointCJ.angularXLimitSpring          = this.jointLimitSpring;
     this.jointCJ.angularYZLimitSpring         = this.jointLimitSpring;
     this.jointCJ.rotationDriveMode            = RotationDriveMode.Slerp;
     this.jointCJ.projectionMode               = JointProjectionMode.PositionAndRotation;
     this.jointCJ.projectionDistance           = 0.01f;
     this.jointCJ.projectionAngle              = 0.01f;
     this.jointCJ.autoConfigureConnectedAnchor = true;
     this.jointCJ.swapBodies                   = true;
     this.jointCJ.enablePreprocessing          = false;
     this.jointCJ.xMotion        = ConfigurableJointMotion.Locked;
     this.jointCJ.yMotion        = ConfigurableJointMotion.Locked;
     this.jointCJ.zMotion        = ConfigurableJointMotion.Locked;
     this.jointCJ.angularXMotion = ConfigurableJointMotion.Limited;
     this.jointCJ.angularYMotion = ConfigurableJointMotion.Limited;
     this.jointCJ.angularZMotion = ConfigurableJointMotion.Limited;
 }
示例#2
0
    // Token: 0x06000134 RID: 308 RVA: 0x0000C79C File Offset: 0x0000A99C
    public GameObject GetJoint(RagdollBodyElements.Joint jointName)
    {
        switch (jointName)
        {
        case RagdollBodyElements.Joint.Core:
            return(this.ragdollJoints[0]);

        case RagdollBodyElements.Joint.ChestLow:
            return(this.ragdollJoints[1]);

        case RagdollBodyElements.Joint.ChestHigh:
            return(this.ragdollJoints[2]);

        case RagdollBodyElements.Joint.Head:
            return(this.ragdollJoints[3]);

        case RagdollBodyElements.Joint.LeftArm:
            return(this.ragdollJoints[4]);

        case RagdollBodyElements.Joint.LeftElbow:
            return(this.ragdollJoints[5]);

        case RagdollBodyElements.Joint.RightArm:
            return(this.ragdollJoints[6]);

        case RagdollBodyElements.Joint.RightElbow:
            return(this.ragdollJoints[7]);

        case RagdollBodyElements.Joint.LeftLeg:
            return(this.ragdollJoints[8]);

        case RagdollBodyElements.Joint.LeftKnee:
            return(this.ragdollJoints[9]);

        case RagdollBodyElements.Joint.LeftFoot:
            return(this.ragdollJoints[10]);

        case RagdollBodyElements.Joint.RightLeg:
            return(this.ragdollJoints[11]);

        case RagdollBodyElements.Joint.RightKnee:
            return(this.ragdollJoints[12]);

        case RagdollBodyElements.Joint.RightFoot:
            return(this.ragdollJoints[13]);

        default:
            Debug.LogError("You haven't selected a valid joint, silly willy!");
            return(null);
        }
    }