public override void Init(GameObject hand, Vector3 axis_in, WhichHands whichHand) { if (transform != null) { axis = axis_in; phalanges = new Phalanx[3]; phalanges[0] = new Phalanx(transform); if (phalanges[0].transform.childCount == 1) { phalanges[1] = new Phalanx(phalanges[0].transform.GetChild(0).transform); if (phalanges[1].transform.childCount == 1) { phalanges[2] = new Phalanx(phalanges[1].transform.GetChild(0).transform); nPhalanges = 3; } else { phalanges[2] = null; nPhalanges = 2; } } else { phalanges[1] = null; nPhalanges = 1; } } }
public override void Init(GameObject hand, Vector3 handRightAxis, WhichHands whichHand) { if (transform != null) { axis1 = transform.InverseTransformDirection(hand.transform.up); if (whichHand == WhichHands.Left) { axis2 = transform.InverseTransformDirection(-hand.transform.forward); } else { axis2 = transform.InverseTransformDirection(hand.transform.forward); } startRotation = transform.localRotation; startRotation *= Quaternion.AngleAxis(45, -axis1); } }
public override void Init(GameObject hand, Vector3 handRightAxis, WhichHands whichHand) { if (transform != null) { axis1 = transform.InverseTransformDirection(hand.transform.up); if (whichHand == WhichHands.Left) axis2 = transform.InverseTransformDirection(-hand.transform.forward); else axis2 = transform.InverseTransformDirection(hand.transform.forward); startRotation = transform.localRotation; startRotation *= Quaternion.AngleAxis(45, -axis1); } }
public abstract void Init(GameObject hand, Vector3 handRightAxis, WhichHands whichHand);