Exemple #1
0
        public override void CreateDependencies(string assetPath)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(assetPath);
            XmlNode root = doc.DocumentElement;

            // Add materials dependencies
            XmlNodeList materialsNode = root.SelectSingleNode("Materials").ChildNodes;

            for (int i = 0; i < materialsNode.Count; i++)
            {
                string materialPath = materialsNode[i].SelectSingleNode("Path").InnerText;
                string name         = materialsNode[i].SelectSingleNode("Name").InnerText;
                string fullPath     = Path.Combine(materialPath, name + ".mat");
                AddDependency <Material>(fullPath);
            }

            // Add mesh dependency
            string meshPath = root.SelectSingleNode("Model").InnerText + ".fbx";

            AddDependency <Mesh>(meshPath);

            string path     = root.SelectSingleNode("Path").InnerText;
            string fileName = Path.GetFileNameWithoutExtension(assetPath);

            // Add it's own prefab dependency
            AddDependency <GameObject>(Path.Combine(path, fileName + ".prefab"));

            // Add prefabs dependencies
            SmallImporterUtils.RecursiveGetTransformDependecies(this, root);
        }
Exemple #2
0
        public override void CreateDependencies(string assetPath)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(assetPath);
            XmlNode root = doc.DocumentElement;

            string path     = root.SelectSingleNode("Path").InnerText;
            string fileName = Path.GetFileNameWithoutExtension(assetPath);

            // Add it's own prefab dependency
            AddDependency <GameObject>(Path.Combine(path, fileName + ".prefab"));

            // Add prefabs dependencies
            SmallImporterUtils.RecursiveGetTransformDependecies(this, root);
        }
Exemple #3
0
        public static void RecursiveGetTransformDependecies(AAssetImporter importer, XmlNode root)
        {
            XmlNode childrenNode = root.SelectSingleNode("Children");

            if (childrenNode != null)
            {
                XmlNodeList childrenNodeList = childrenNode.ChildNodes;
                for (int i = 0; i < childrenNodeList.Count; i++)
                {
                    string type = childrenNodeList[i].SelectSingleNode("Type").InnerText;
                    if (type == "MESH" || type == "LIGHT" || type == "CAMERA")
                    {
                        string path = childrenNodeList[i].SelectSingleNode("Prefab").InnerText;
                        importer.AddDependency <GameObject>(path);
                    }

                    SmallImporterUtils.RecursiveGetTransformDependecies(importer, childrenNodeList[i]);
                }
            }
        }
Exemple #4
0
        public override void CreateDependencies(string assetPath)
        {
            XmlDocument xml = new XmlDocument();

            xml.Load(assetPath);
            XmlNode root = xml.DocumentElement;

            // Add textures dependencies
            XmlNode channels = root.SelectSingleNode("Channels");

            if (channels != null)
            {
                foreach (XmlNode node in channels.ChildNodes)
                {
                    if (node != null && SmallParserUtils.IsValidTextureXml(node.InnerText))
                    {
                        AddDependency <Texture>(SmallImporterUtils.GetTexturePath(node.InnerText));
                    }
                }
            }
        }
Exemple #5
0
 public override void OnPreImport(string assetPath)
 {
     SmallImporterUtils.CreatePrefabFromXml(assetPath);
 }
Exemple #6
0
 public override void OnPreImport(string assetPath)
 {
     _material = SmallImporterUtils.CreateMaterialFromXml(assetPath);
 }