Esempio n. 1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("sprites", Sprites.ExportYAML(container));
            node.Add("outline", Outline.ExportYAML(container));
            node.Add("physicsShape", PhysicsShape.ExportYAML(container));
            return(node);
        }
Esempio n. 2
0
        public override YAMLNode ExportYAML(IAssetsExporter exporter)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(exporter);

            node.Add("mode", Mode);
            node.Add("frameOverTime", FrameOverTime.ExportYAML(exporter));
            node.Add("startFrame", StartFrame.ExportYAML(exporter));
            node.Add("tilesX", TilesX);
            node.Add("tilesY", TilesY);
            node.Add("animationType", AnimationType);
            node.Add("rowIndex", RowIndex);
            node.Add("cycles", Cycles);
            node.Add("uvChannelMask", UvChannelMask);
            node.Add("flipU", FlipU);
            node.Add("flipV", FlipV);
            node.Add("randomRow", RandomRow);
            node.Add("sprites", IsReadSprites(exporter.Version) ? Sprites.ExportYAML(exporter) : YAMLSequenceNode.Empty);
            return(node);
        }
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(SpritesName, Sprites.ExportYAML(container));
            if (SpriteMetaData.HasOutline(container.ExportVersion))
            {
                node.Add(OutlineName, Outline.ExportYAML(container));
            }
            if (SpriteMetaData.HasPhysicsShape(container.ExportVersion))
            {
                node.Add(PhysicsShapeName, PhysicsShape.ExportYAML(container));
            }
            if (SpriteMetaData.HasBones(container.ExportVersion))
            {
                node.Add(BonesName, Bones.ExportYAML(container));
                node.Add(SpriteIDName, SpriteID);
            }
            if (SpriteMetaData.HasInternalID(container.ExportVersion))
            {
                node.Add(InternalIDName, InternalID);
            }
            if (SpriteMetaData.HasBones(container.ExportVersion))
            {
                node.Add(VerticesName, Vertices.ExportYAML(container));
                node.Add(IndicesName, Indices.ExportYAML(true));
                node.Add(EdgesName, Edges.ExportYAML(container));
                node.Add(WeightsName, Weights.ExportYAML(container));
            }
            if (HasSecondaryTextures(container.ExportVersion))
            {
                node.Add(SecondaryTexturesName, SecondaryTextures.ExportYAML(container));
            }
            return(node);
        }