Пример #1
0
        public List <UniqueSpriteBone> GetRawData()
        {
            if (m_OrderDirty)
            {
                SortBones();
            }

            var bones = new List <UniqueSpriteBone>();

            foreach (var bone in m_BoneList.bones)
            {
                var spriteBone = new UniqueSpriteBone();
                spriteBone.name     = bone.name;
                spriteBone.parentId = bone.parentId;

                // Store position in mesh/rect space for root.
                Vector3 position = bone.isRoot ? bone.localPosition - m_Offset : bone.localPosition;
                position.z          = bone.depth;
                spriteBone.position = position;
                spriteBone.rotation = bone.localRotation;
                spriteBone.length   = bone.length;
                spriteBone.id       = new GUID(bone.uniqueId);
                bones.Add(spriteBone);
            }

            return(bones);
        }
        private List <UniqueSpriteBone> NormalToUnique(List <SpriteBone> spriteBones)
        {
            List <UniqueSpriteBone> uniqueBones = new List <UniqueSpriteBone>();

            foreach (var n in spriteBones)
            {
                var u = new UniqueSpriteBone(n);
                u.id = GUID.Generate();
                uniqueBones.Add(u);
            }

            return(uniqueBones);
        }