// Token: 0x060001C2 RID: 450 RVA: 0x0000722C File Offset: 0x0000542C private global::AuthorChJoint AddJoint(global::AuthorChJoint.Kind kind) { global::AuthorChJoint authorChJoint = base.creation.CreatePeice <global::AuthorChJoint>(kind.ToString(), new Type[0]); if (authorChJoint) { authorChJoint.InitializeFromOwner(this, kind); Array.Resize <global::AuthorChJoint>(ref this.myJoints, (this.myJoints != null) ? (this.myJoints.Length + 1) : 1); this.myJoints[this.myJoints.Length - 1] = authorChJoint; } return(authorChJoint); }
// Token: 0x060001F2 RID: 498 RVA: 0x00009320 File Offset: 0x00007520 internal void InitializeFromOwner(global::AuthorChHit self, global::AuthorChJoint.Kind kind) { this.self = self; this.kind = kind; global::AuthorShared.SetDirty(this); }
// Token: 0x060001F1 RID: 497 RVA: 0x00009088 File Offset: 0x00007288 public override bool PeiceInspectorGUI() { bool flag = base.PeiceInspectorGUI(); string peiceID = base.peiceID; if (global::AuthorShared.StringField("Title", ref peiceID, new GUILayoutOption[0])) { base.peiceID = peiceID; flag = true; } global::AuthorShared.EnumField("Kind", this.kind, new GUILayoutOption[0]); global::AuthorShared.PrefixLabel("Self"); if (GUILayout.Button(global::AuthorShared.ObjectContent <global::AuthorChHit>(this.self, typeof(global::AuthorChHit)), new GUILayoutOption[0])) { global::AuthorShared.PingObject(this.self); } flag |= global::AuthorShared.PeiceField <global::AuthorChHit>("Connected", this, ref this.connect, typeof(global::AuthorChHit), GUI.skin.button, new GUILayoutOption[0]); flag |= global::AuthorShared.Toggle("Reverse Link", ref this.reverseLink, new GUILayoutOption[0]); flag |= global::AuthorShared.Vector3Field("Anchor", ref this.anchor, new GUILayoutOption[0]); flag |= global::AuthorShared.Vector3Field("Axis", ref this.axis, new GUILayoutOption[0]); global::AuthorChJoint.Kind kind = this.kind; if (kind != global::AuthorChJoint.Kind.Hinge) { if (kind == global::AuthorChJoint.Kind.Character) { flag |= global::AuthorShared.Vector3Field("Swing Axis", ref this.swingAxis, new GUILayoutOption[0]); SoftJointLimit softJointLimit = this.lowTwist; if (global::AuthorChJoint.Field("Low Twist", ref softJointLimit, ref this.twistOffset)) { flag = true; this.lowTwist = softJointLimit; } softJointLimit = this.highTwist; if (global::AuthorChJoint.Field("High Twist", ref softJointLimit, ref this.twistOffset)) { flag = true; this.highTwist = softJointLimit; } softJointLimit = this.swing1; if (global::AuthorChJoint.Field("Swing 1", ref softJointLimit, ref this.swingOffset1)) { flag = true; this.swing1 = softJointLimit; } softJointLimit = this.swing2; if (global::AuthorChJoint.Field("Swing 2", ref softJointLimit, ref this.swingOffset2)) { flag = true; this.swing2 = softJointLimit; } } } else { JointLimits limit = this.limit; if (global::AuthorChJoint.Field("Limits", ref limit, ref this.useLimit, ref this.limitOffset)) { flag = true; this.limit = limit; } } flag |= global::AuthorShared.FloatField("Break Force", ref this.breakForce, new GUILayoutOption[0]); return(flag | global::AuthorShared.FloatField("Break Torque", ref this.breakTorque, new GUILayoutOption[0])); }
// 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); }