public void Attach(bool disparentHands = true, IKFixer optional = null) { if (optional == null) { optional = transform.root.GetComponent <IKFixer>(); } if (optional == null) { return; } lastIK = optional; /* * DISPARENT HANDS, USED FOR WEAPONS * */ if (disparentHands) { IKData.IK getIK = IKData.GetItemIK(lastIK.PlayerClass, gameObject.name); transform.localPosition = getIK.objLocalPosition; transform.localEulerAngles = getIK.objLocalEulerAngles; transform.localScale = getIK.objLocalScale; if (IKLeft != null) { IKLeft.localPosition = getIK.leftHandPosition; IKLeft.localEulerAngles = getIK.leftHandEulerAngles; IKLeft.SetParent(transform.parent); } if (IKRight != null) { IKRight.localPosition = getIK.rightHandPosition; IKRight.localEulerAngles = getIK.rightHandEulerAngles; IKRight.SetParent(transform.parent); } handsDisparented = true; } /* * */ optional.attachLeft = IKLeft; optional.attachRight = IKRight; }