예제 #1
0
        public void Apply(SerializedObject so)
        {
            so.FindProperty("m_Alignment").intValue                  = (int)alignment;
            so.FindProperty("m_SpriteBorder").vector4Value           = border;
            so.FindProperty("m_SpritePivot").vector2Value            = pivot;
            so.FindProperty("m_SpriteTessellationDetail").floatValue = tessellationDetail;
            so.FindProperty("m_SpriteSheet.m_SpriteID").stringValue  = spriteID.ToString();
            so.FindProperty("m_SpriteSheet.m_InternalID").longValue  = internalID;

            var sp = so.FindProperty("m_SpriteSheet");

            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);
            }
        }
예제 #2
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);
            }
        }