public void Read(AssetReader reader)
        {
            Sprites = reader.ReadAssetArray <SpriteMetaData>();
            if (SpriteMetaData.HasOutline(reader.Version))
            {
                Outline = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (SpriteMetaData.HasPhysicsShape(reader.Version))
            {
                PhysicsShape = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (SpriteMetaData.HasBones(reader.Version))
            {
                Bones    = reader.ReadAssetArray <SpriteBone>();
                SpriteID = reader.ReadString();
            }
            if (SpriteMetaData.HasInternalID(reader.Version))
            {
                InternalID = reader.ReadInt64();
            }
            if (SpriteMetaData.HasBones(reader.Version))
            {
                Vertices = reader.ReadAssetArray <Vector2f>();
                Indices  = reader.ReadInt32Array();
                Edges    = reader.ReadAssetArray <Int2Storage>();
                reader.AlignStream();

                Weights = reader.ReadAssetArray <BoneWeights4>();
                reader.AlignStream();
            }
            if (HasSecondaryTextures(reader.Version))
            {
                SecondaryTextures = reader.ReadAssetArray <SecondarySpriteTexture>();
            }
        }
Example #2
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Rect.Read(reader);
            Offset.Read(reader);
            if (HasBorder(reader.Version))
            {
                Border.Read(reader);
            }
            PixelsToUnits = reader.ReadSingle();
            if (HasPivot(reader.Version))
            {
                Pivot.Read(reader);
            }
            Extrude = reader.ReadUInt32();
            if (HasPolygon(reader.Version))
            {
                IsPolygon = reader.ReadBoolean();
                reader.AlignStream();
            }
#if UNIVERSAL
            if (HasAtlasName(reader.Flags))
            {
                AtlasName  = reader.ReadString();
                PackingTag = reader.ReadString();
            }
#endif

            if (HasRendererData(reader.Version))
            {
                RenderDataKey = reader.ReadTupleTLong <GUID>();
                AtlasTags     = reader.ReadStringArray();
                SpriteAtlas.Read(reader);
            }
            RD.Read(reader);
#if UNIVERSAL
            if (HasAtlasRD(reader.Version, reader.Flags))
            {
                AtlasRD.Read(reader);
            }
#endif
            reader.AlignStream();

            if (HasPhysicsShape(reader.Version))
            {
                PhysicsShape = reader.ReadAssetArrayArray <Vector2f>();
            }

            if (HasBones(reader.Version))
            {
                Bones = reader.ReadAssetArray <SpriteBone>();
            }
#if UNIVERSAL
            if (HasSpriteID(reader.Version, reader.Flags))
            {
                SpriteID = reader.ReadString();
            }
#endif
        }
Example #3
0
        public void Read(AssetReader reader)
        {
            Name = reader.ReadString();
            Rect.Read(reader);
            Alignment = (SpriteAlignment)reader.ReadInt32();
            Pivot.Read(reader);
            if (HasBorder(reader.Version))
            {
                Border.Read(reader);
            }
            if (HasOutline(reader.Version))
            {
                Outline = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (HasPhysicsShape(reader.Version))
            {
                PhysicsShape = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (HasTessellationDetail(reader.Version))
            {
                TessellationDetail = reader.ReadSingle();
            }
            if (HasBones(reader.Version))
            {
                Bones    = reader.ReadAssetArray <SpriteBone>();
                SpriteID = reader.ReadString();
            }
            if (HasInternalID(reader.Version))
            {
                InternalID = reader.ReadInt64();
            }
            if (HasBones(reader.Version))
            {
                Vertices = reader.ReadAssetArray <Vector2f>();
                Indices  = reader.ReadInt32Array();
                Edges    = reader.ReadAssetArray <Int2Storage>();
                reader.AlignStream();

                Weights = reader.ReadAssetArray <BoneWeights4>();
                reader.AlignStream();
            }
        }
Example #4
0
 public void Read(AssetReader reader)
 {
     Collider.Read(reader);
     if (IsReadDoubleColliderPath(reader.Version))
     {
         m_colliderPaths = reader.ReadAssetArrayArray <IntPoint>();
     }
     else
     {
         IntPoint[] colliderPaths = reader.ReadAssetArray <IntPoint>();
         m_colliderPaths = new IntPoint[][] { colliderPaths };
     }
     reader.AlignStream(AlignType.Align4);
 }
Example #5
0
 public void Read(AssetReader reader)
 {
     Paths = reader.ReadAssetArrayArray <Vector2f>();
     reader.AlignStream();
 }
Example #6
0
 public void Read(AssetReader reader)
 {
     Collider.Read(reader);
     m_colliderPaths = reader.ReadAssetArrayArray <IntPoint>();
     reader.AlignStream(AlignType.Align4);
 }
Example #7
0
 public void Read(AssetReader reader)
 {
     m_paths = reader.ReadAssetArrayArray <Vector2f>();
     reader.AlignStream(AlignType.Align4);
 }