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 (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);
            }
        }
        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();

            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);
            }
        }
示例#3
0
        public void Apply(SerializedObject so)
        {
            so.FindProperty("m_Alignment").intValue                  = (int)base.alignment;
            so.FindProperty("m_SpriteBorder").vector4Value           = base.border;
            so.FindProperty("m_SpritePivot").vector2Value            = base.pivot;
            so.FindProperty("m_SpriteTessellationDetail").floatValue = this.tessellationDetail;
            so.FindProperty("m_SpriteSheet.m_SpriteID").stringValue  = base.spriteID.ToString();
            SerializedProperty rectSP = so.FindProperty("m_SpriteSheet");

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