Beispiel #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);
        }
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("name", Name);
            node.Add("rect", Rect.ExportYAML(container));
            node.Add("alignment", (int)Alignment);
            node.Add("pivot", Pivot.ExportYAML(container));
            node.Add("border", Border.ExportYAML(container));
            node.Add("outline", Outline.ExportYAML(container));
            node.Add("physicsShape", PhysicsShape.ExportYAML(container));
            node.Add("tessellationDetail", TessellationDetail);
            return(node);
        }
Beispiel #3
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(NameName, Name);
            node.Add(RectName, Rect.ExportYAML(container));
            node.Add(AlignmentName, (int)Alignment);
            node.Add(PivotName, Pivot.ExportYAML(container));
            if (HasBorder(container.ExportVersion))
            {
                node.Add(BorderName, Border.ExportYAML(container));
            }
            if (HasOutline(container.ExportVersion))
            {
                node.Add(OutlineName, Outline.ExportYAML(container));
            }
            if (HasPhysicsShape(container.ExportVersion))
            {
                node.Add(PhysicsShapeName, PhysicsShape.ExportYAML(container));
            }
            if (HasTessellationDetail(container.ExportVersion))
            {
                node.Add(TessellationDetailName, TessellationDetail);
            }
            if (HasBones(container.ExportVersion))
            {
                node.Add(BonesName, Bones.ExportYAML(container));
                node.Add(SpriteIDName, SpriteID);
            }
            if (HasInternalID(container.ExportVersion))
            {
                node.Add(InternalIDName, InternalID);
            }
            if (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));
            }
            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);
        }