Esempio n. 1
0
        public Vector3 GetBodyPartPosition(string bodyPartName)
        {
            V_Skeleton_Anim bodyPartAnim = GetSkeletonUpdater().GetAnimWithBodyPartName(bodyPartName);

            if (bodyPartAnim != null)
            {
                Vector3 pos = bodyPartAnim.GetCurrentAnimFrame().pos;
                return(ConvertLocalPositionToWorldPosition(pos));
            }
            else
            {
                return(ConvertLocalPositionToWorldPosition(Vector3.zero));
            }
        }
Esempio n. 2
0
        private void Play()
        {
            int verticesIndex  = 0;
            int uvsIndex       = 0;
            int trianglesIndex = 0;

            for (int i = 0; i < animsLength; i++)
            {
                V_Skeleton_Anim  anim  = anims[i];
                V_Skeleton_Frame frame = anim.GetCurrentAnimFrame();

                V_UnitSkeleton.AddSquare(i, verticesIndex, verticesArr, uvsIndex, uvsArr, trianglesIndex, trianglesArr, frame.pos, frame.v00 + frame.v00offset, frame.v01 + frame.v01offset, frame.v10 + frame.v10offset, frame.v11 + frame.v11offset, V_UnitSkeleton.GetUV_Type(frame.uvType));
                verticesIndex  = verticesIndex + 4;
                uvsIndex       = uvsIndex + 4;
                trianglesIndex = trianglesIndex + 6;
            }

            //mesh.triangles = null;
            mesh.Clear();
            mesh.vertices  = verticesArr;
            mesh.uv        = uvsArr;
            mesh.triangles = trianglesArr;
        }