Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
        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;
                }
            }
        }
Exemplo n.º 5
0
 public abstract void Init(GameObject hand, Vector3 handRightAxis, WhichHands whichHand);
Exemplo n.º 6
0
 public abstract void Init(GameObject hand, Vector3 handRightAxis, WhichHands whichHand);