コード例 #1
0
ファイル: ModelFormatTCN.cs プロジェクト: NovaDelta/mcskin3d
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "type")
                {
                    type = a.Value;
                }
                else if (a.Name.ToLower() == "name")
                {
                    Name = a.Value;
                }
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "shape")
                {
                    var shape = new TCNShape();
                    shape.Parse(child);
                    Shapes.Add(shape);
                }
            }
        }
コード例 #2
0
ファイル: ModelFormatTCN.cs プロジェクト: NovaDelta/mcskin3d
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "texture")
                {
                    texture = a.Value;
                }
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "baseclass")
                {
                    BaseClass = child.InnerText;
                }
                else if (name == "geometry")
                {
                    TCNFolder rootFolder = new TCNFolder();

                    foreach (XmlNode folderChild in child.ChildNodes)
                    {
                        if (folderChild.Name.ToLower() == "folder")
                        {
                            var folder = new TCNFolder();
                            folder.Parse(folderChild);
                            Geometry.Add(folder);
                        }
                        else if (folderChild.Name.ToLower() == "shape")
                        {
                            var shape = new TCNShape();
                            shape.Parse(folderChild);
                            rootFolder.Shapes.Add(shape);
                        }
                    }

                    if (rootFolder.Shapes.Count != 0)
                    {
                        Geometry.Add(rootFolder);
                    }
                }
                else if (name == "glscale")
                {
                    GlScale = Mesh.StringToVertex3(child.InnerText);
                }
                else if (name == "name")
                {
                    Name = child.InnerText;
                }
                else if (name == "texturesize")
                {
                    TextureSize = Mesh.StringToVertex2(child.InnerText);
                }
            }
        }
コード例 #3
0
ファイル: ModelFormatTCN.cs プロジェクト: rmbzlib/mcskin3d
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "texture")
                    texture = a.Value;
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "baseclass")
                    BaseClass = child.InnerText;
                else if (name == "geometry")
                {
                    TCNFolder rootFolder = new TCNFolder();

                    foreach (XmlNode folderChild in child.ChildNodes)
                    {
                        if (folderChild.Name.ToLower() == "folder")
                        {
                            var folder = new TCNFolder();
                            folder.Parse(folderChild);
                            Geometry.Add(folder);
                        }
                        else if (folderChild.Name.ToLower() == "shape")
                        {
                            var shape = new TCNShape();
                            shape.Parse(folderChild);
                            rootFolder.Shapes.Add(shape);
                        }
                    }

                    if (rootFolder.Shapes.Count != 0)
                        Geometry.Add(rootFolder);
                }
                else if (name == "glscale")
                    GlScale = Mesh.StringToVertex3(child.InnerText);
                else if (name == "name")
                    Name = child.InnerText;
                else if (name == "texturesize")
                    TextureSize = Mesh.StringToVertex2(child.InnerText);
            }
        }
コード例 #4
0
ファイル: ModelFormatTCN.cs プロジェクト: rmbzlib/mcskin3d
        public void Parse(XmlNode node)
        {
            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "type")
                    type = a.Value;
                else if (a.Name.ToLower() == "name")
                    Name = a.Value;
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "shape")
                {
                    var shape = new TCNShape();
                    shape.Parse(child);
                    Shapes.Add(shape);
                }
            }
        }