Esempio n. 1
0
        /// <summary>
        /// Automatically build the chain
        /// </summary>
        /// <param name="anim"></param>
        public void AutoBuild(Animator anim)
        {
            if (anim == null)
            {
                Debug.LogError("The Animator component passed is NULL");
                return;
            }

            RigReader rigReader = new RigReader(anim);

            switch (LegType)
            {
            case HumanLegs.RightLeg:
                var tempR = rigReader.BuildChain(LegType);
                Chain.Joints = tempR.Joints;
                break;

            case HumanLegs.LeftLeg:
                var tempL = rigReader.BuildChain(LegType);
                Chain.Joints = tempL.Joints;
                break;
            }

            Init();
        }
        public void BuildRig()
        {
            rArm = rigReader.BuildChain(HumanPart.RightArm);
            lArm = rigReader.BuildChain(HumanPart.LeftArm);

            rLeg = rigReader.BuildChain(HumanPart.RightLeg);
            lLeg = rigReader.BuildChain(HumanPart.LeftLeg);
        }