// Token: 0x060001E6 RID: 486 RVA: 0x00008668 File Offset: 0x00006868 private void ConfigureJointShared(Joint joint, Transform root, ref global::AuthorChHit.Rep self) { if (this.connect) { global::AuthorChHit.Rep rep; if (self.mirrored) { rep = this.connect.secondary; if (!rep.valid) { rep = this.connect.primary; } } else { rep = this.connect.primary; if (!rep.valid) { rep = this.connect.secondary; } } if (rep.valid) { Transform transform = root.FindChild(rep.path); Rigidbody rigidbody = transform.rigidbody; if (!rigidbody) { rigidbody = transform.gameObject.AddComponent <Rigidbody>(); } joint.connectedBody = rigidbody; } else { Debug.LogWarning("No means of making/getting rigidbody", this.connect); } } joint.anchor = self.Flip(this.anchor); joint.axis = self.AxisFlip(this.axis); joint.breakForce = this.breakForce; joint.breakTorque = this.breakTorque; }
// Token: 0x060001EA RID: 490 RVA: 0x000088F0 File Offset: 0x00006AF0 private bool DoTransformHandles(ref global::AuthorChHit.Rep self, ref global::AuthorChHit.Rep connect) { if (!self.valid) { return(false); } Vector3 v = self.Flip(this.anchor); Vector3 vector = self.AxisFlip(this.axis); Vector3 vector2 = self.AxisFlip(this.swingAxis); Matrix4x4 matrix = global::AuthorShared.Scene.matrix; if (connect.valid) { global::AuthorShared.Scene.matrix = connect.bone.localToWorldMatrix; Color color = global::AuthorShared.Scene.color; global::AuthorShared.Scene.color = color * new Color(1f, 1f, 1f, 0.4f); Vector3 vector3 = connect.bone.InverseTransformPoint(self.bone.position); if (vector3 != Vector3.zero) { global::AuthorShared.Scene.DrawBone(Vector3.zero, Quaternion.LookRotation(vector3), vector3.magnitude, 0.02f, new Vector3(0.05f, 0.05f, 0.5f)); } global::AuthorShared.Scene.color = color; } global::AuthorShared.Scene.matrix = self.bone.localToWorldMatrix; bool result = false; if (global::AuthorShared.Scene.PivotDrag(ref v, ref vector)) { result = true; this.anchor = self.Flip(v); this.axis = self.AxisFlip(vector); } global::AuthorChJoint.Kind kind = this.kind; if (kind != global::AuthorChJoint.Kind.Hinge) { if (kind == global::AuthorChJoint.Kind.Character) { Color color2 = global::AuthorShared.Scene.color; global::AuthorShared.Scene.color = color2 * global::AuthorChJoint.twistColor; SoftJointLimit softJointLimit = this.lowTwist; SoftJointLimit highTwist = this.highTwist; if (global::AuthorShared.Scene.LimitDrag(v, vector, ref this.twistOffset, ref softJointLimit, ref highTwist)) { result = true; this.lowTwist = softJointLimit; this.highTwist = highTwist; } global::AuthorShared.Scene.color = color2 * global::AuthorChJoint.swing1Color; softJointLimit = this.swing1; if (global::AuthorShared.Scene.LimitDrag(v, vector2, ref this.swingOffset1, ref softJointLimit)) { result = true; this.swing1 = softJointLimit; } global::AuthorShared.Scene.color = color2 * global::AuthorChJoint.swing2Color; softJointLimit = this.swing2; if (global::AuthorShared.Scene.LimitDrag(v, Vector3.Cross(vector2, vector), ref this.swingOffset2, ref softJointLimit)) { result = true; this.swing2 = softJointLimit; } global::AuthorShared.Scene.color = color2; } } else if (this.useLimit) { JointLimits limit = this.limit; if (global::AuthorShared.Scene.LimitDrag(v, vector, ref this.limitOffset, ref limit)) { result = true; this.limit = limit; } } global::AuthorShared.Scene.matrix = matrix; return(result); }