private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
        {
            foreach (string imported in importedAssets)
            {
                if (UseThisImporter(imported))
                {
                    //Debug.Log(string.Format("Imported: {0}", imported));
                }
                else
                {
                    continue;
                }

#if !UNITY_WEBPLAYER
                using (ImportTiled2Unity t2uImporter = new ImportTiled2Unity(imported))
                {
                    if (t2uImporter.IsTiled2UnityFile())
                    {
                        // Start the import process. This will trigger textures and meshes to be imported as well.
                        t2uImporter.ImportBegin(imported, t2uImporter);
                    }
                    else if (t2uImporter.IsTiled2UnityTexture())
                    {
                        // A texture was imported. Once all textures are imported then we'll import materials.
                        t2uImporter.TextureImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityMaterial())
                    {
                        // A material was imported. Once all materials are imported then we'll import meshes.
                        t2uImporter.MaterialImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityWavefrontObj())
                    {
                        // A mesh was imported. Once all meshes are imported we'll import the prefabs.
                        t2uImporter.MeshImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityPrefab())
                    {
                        // A prefab was imported. Once all prefabs are imported then the import is complete.
                        t2uImporter.PrefabImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityTmx())
                    {
                        // A TMX - let's kick off an autobuild
                        t2uImporter.TmxImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityTsx())
                    {
                        // A tileset - let's make that available for terrain lookups
                        t2uImporter.TsxImported(imported);
                    }
                }
#endif
            }
        }
Пример #2
0
        private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
        {
            foreach (string imported in importedAssets)
            {
                if (UseThisImporter(imported))
                {
                    //Debug.Log(string.Format("Imported: {0}", imported));
                }
                else
                {
                    continue;
                }

#if !UNITY_WEBPLAYER
                using (ImportTiled2Unity t2uImporter = new ImportTiled2Unity(imported))
                {
                    if (t2uImporter.IsTiled2UnityFile())
                    {
                        // Start the import process. This will trigger textures and meshes to be imported as well.
                        t2uImporter.ImportBegin(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityTexture())
                    {
                        // A texture was imported and the material assigned to it may need to be fixed
                        t2uImporter.TextureImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityWavefrontObj())
                    {
                        // Now that the mesh has been imported we will build the prefab
                        t2uImporter.MeshImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityPrefab())
                    {
                        // Now the the prefab is built and imported we are done
                        t2uImporter.ImportFinished(imported);
                        Debug.Log(string.Format("Imported prefab from Tiled map editor: {0}", imported));
                    }
                }
#endif
            }
        }
        private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
        {
            foreach (string imported in importedAssets)
            {
                if (UseThisImporter(imported))
                {
                   //Debug.Log(string.Format("Imported: {0}", imported));
                }
                else
                {
                    continue;
                }

#if !UNITY_WEBPLAYER
                using (ImportTiled2Unity t2uImporter = new ImportTiled2Unity(imported))
                {
                    if (t2uImporter.IsTiled2UnityFile())
                    {
                        // Start the import process. This will trigger textures and meshes to be imported as well.
                        t2uImporter.ImportBegin(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityTexture())
                    {
                        // A texture was imported and the material assigned to it may need to be fixed
                        t2uImporter.TextureImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityWavefrontObj())
                    {
                        // Now that the mesh has been imported we will build the prefab
                        t2uImporter.MeshImported(imported);
                    }
                    else if (t2uImporter.IsTiled2UnityPrefab())
                    {
                        // Now the the prefab is built and imported we are done
                        t2uImporter.ImportFinished(imported);
                        Debug.Log(string.Format("Imported prefab from Tiled map editor: {0}", imported));
                    }
                }
#endif
            }
        }