Exemple #1
0
        private static void InitModelImportItem(XmlElement element)
        {
            List <ModelImportItem> items = new List <ModelImportItem>();

            for (int i = 0; i < element.ChildNodes.Count; i++)
            {
                XmlElement curElement = element.ChildNodes[i] as XmlElement;
                if (curElement.Name != "Item")
                {
                    continue;
                }

                ModelImportItem item = new ModelImportItem(curElement.GetAttribute("path"));
                item.importMaterials   = curElement.GetAttribute("importMaterials").Equals("true");
                item.meshCompression   = (ModelImporterMeshCompression)Enum.Parse(typeof(ModelImporterMeshCompression), curElement.GetAttribute("meshCompression"), true);
                item.optimizeMesh      = curElement.GetAttribute("optimizeMesh").Equals("true");
                item.isReadable        = curElement.GetAttribute("isReadable").Equals("true");
                item.importBlendShapes = curElement.GetAttribute("importBlendShapes").Equals("true");

                item.importTangents = (ModelImporterTangents)Enum.Parse(typeof(ModelImporterTangents), curElement.GetAttribute("importTangents"), true);
                item.importNormals  = (ModelImporterNormals)Enum.Parse(typeof(ModelImporterNormals), curElement.GetAttribute("importNormals"), true);

                items.Add(item);
            }

            modelImportItems = items.ToArray();
        }
Exemple #2
0
        public static ModelImportItem GetModelImportItem(string path)
        {
            if (modelImportItems == null)
            {
                Init();
            }
            path = FileOperateUtil.GetRegPath(path);
            for (int i = 0; i < modelImportItems.Length; i++)
            {
                ModelImportItem item  = modelImportItems[i];
                Match           match = item.MatchPath(path);
                if (match.Success)
                {
                    return(item);
                }
            }

            return(null);
        }