コード例 #1
0
        public void Apply(SerializedProperty sp)
        {
            sp.FindPropertyRelative("m_Rect").rectValue                = rect;
            sp.FindPropertyRelative("m_Name").stringValue              = name;
            sp.FindPropertyRelative("m_Border").vector4Value           = border;
            sp.FindPropertyRelative("m_Alignment").intValue            = (int)alignment;
            sp.FindPropertyRelative("m_Pivot").vector2Value            = pivot;
            sp.FindPropertyRelative("m_TessellationDetail").floatValue = tessellationDetail;
            sp.FindPropertyRelative("m_SpriteID").stringValue          = spriteID.ToString();
            if (internalID == 0L)
            {
                UnityType spriteType = UnityType.FindTypeByName("Sprite");
                internalID = ImportSettingInternalID.MakeInternalID(sp.serializedObject, spriteType, name);
            }

            sp.FindPropertyRelative("m_InternalID").longValue = internalID;

            if (spriteBone != null)
            {
                SpriteBoneDataTransfer.Apply(sp, spriteBone);
            }
            if (spriteOutline != null)
            {
                SpriteOutlineDataTransfer.Apply(sp, spriteOutline);
            }
            if (spritePhysicsOutline != null)
            {
                SpritePhysicsOutlineDataTransfer.Apply(sp, spritePhysicsOutline);
            }
            if (vertices != null)
            {
                SpriteMeshDataTransfer.Apply(sp, vertices, indices, edges);
            }
        }