Exemplo n.º 1
0
        public void UpdateIKTargets(IKSnaphotType type, bool isLeft)
        {
            Debug.Log("UpdateIKTarget for: " + type);
            IKSnapShot snapShot = GetSnapShot(type);

            Vector3 targetBodyPos = snapShot.bodyPos;

            if (isLeft)
            {
                targetBodyPos.x = -targetBodyPos.x;
            }

            bodyHelper.localPosition = targetBodyPos;

            handHelper.localPosition    = snapShot.handPos;
            handHelper.localEulerAngles = snapShot.handEulers;

            if (snapShot.overrideHeadPos)
            {
                headHelper.localPosition = snapShot.headPos;
            }
            else
            {
                headHelper.localPosition = defaultHeadPos;
            }
        }
Exemplo n.º 2
0
        IKSnapShot GetSnapShot(IKSnaphotType type)
        {
            for (int i = 0; i < ikSnapshots.Length; i++)
            {
                if (ikSnapshots[i].type == type)
                {
                    return(ikSnapshots[i]);
                }
            }

            return(null);
        }