コード例 #1
0
ファイル: ModelPath.cs プロジェクト: zhutaorun/unitygame
        protected void onFindOneFile(string fullPath)
        {
            string ext = ExportUtil.getFileExt(fullPath);
            if (m_ignoreExtList.IndexOf(ext) == -1)
            {
                string fileName = ExportUtil.getFileNameWithExt(fullPath);
                Mesh mesh = new Mesh();
                mesh.skelMeshParam.m_name = fileName;
                mesh.skelMeshParam.m_inPath = m_inPath;
                mesh.skelMeshParam.m_outPath = m_outPath;
                mesh.skelMeshParam.m_resType = m_resType;
                mesh.skelMeshParam.m_controllerPath = m_controllerPath;

                mesh.addSubMesh();

                SkinAnimSys.m_instance.m_xmlSkinMeshRoot.m_meshList.Add(mesh);
            }
        }
コード例 #2
0
ファイル: XmlParseBase.cs プロジェクト: zhutaorun/unitygame
        virtual public void parseXml(string path, XmlRootBase xmlRoot)
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(path);

            XmlNode rootNode = xmlDoc.SelectSingleNode("Root");
            xmlRoot.m_outPath = ExportUtil.getXmlAttrStr(rootNode.Attributes["outpath"]);
            if (xmlRoot is XmlSkinMeshRoot)
            {
                (xmlRoot as XmlSkinMeshRoot).m_exportFileType = (eExportFileType)ExportUtil.getXmlAttrInt(rootNode.Attributes["ExportFileType"]);
            }
            //XmlNodeList packNodeList = rootNode.ChildNodes;
            // Mesh 节点
            XmlNodeList packNodeList = rootNode.SelectNodes("Mesh");
            XmlElement packElem;
            Mesh mesh;

            foreach (XmlNode packNode in packNodeList)
            {
                packElem = (XmlElement)packNode;
                mesh = new Mesh();
                xmlRoot.m_meshList.Add(mesh);
                mesh.parseXml(packElem);
            }

            // ModelTypes 节点
            XmlNode xmlModelTypesNode = rootNode.SelectSingleNode("ModelTypes");
            xmlRoot.m_modelTypes.parseXml(xmlModelTypesNode as XmlElement);

            // Path 节点
            ModelPath modelPath;
            packNodeList = rootNode.SelectNodes("ModelPath");
            foreach (XmlNode packNode in packNodeList)
            {
                packElem = (XmlElement)packNode;
                modelPath = new ModelPath();
                xmlRoot.m_modelPathList.Add(modelPath);
                modelPath.parseXml(packElem);
            }
        }