public override bool Export(ProjectAssetContainer container, string dirPath) { string folderPath = Path.Combine(dirPath, OcclusionCullingSettings.SceneExportFolder); string fileName = $"{Name}.unity"; string filePath = Path.Combine(folderPath, fileName); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } AssetExporter.Export(container, Components, filePath); DefaultImporter sceneImporter = new DefaultImporter(false); Meta meta = new Meta(sceneImporter, GUID); ExportMeta(container, meta, filePath); string subFolderPath = Path.Combine(folderPath, Name); if (OcclusionCullingData != null) { ExportAsset(container, OcclusionCullingData, subFolderPath); } if (LightingDataAsset != null) { ExportAsset(container, OcclusionCullingData, subFolderPath); } if (m_navMeshData != null) { ExportAsset(container, m_navMeshData, subFolderPath); } return(true); }
public override bool Export(ProjectAssetContainer container, string dirPath) { TryInitialize(container); string folderPath = Path.Combine(dirPath, Object.AssetsKeyWord, OcclusionCullingSettings.SceneKeyWord); string sceneSubPath = GetSceneName(container); string fileName = $"{sceneSubPath}.unity"; string filePath = Path.Combine(folderPath, fileName); folderPath = Path.GetDirectoryName(filePath); if (!DirectoryUtils.Exists(folderPath)) { DirectoryUtils.CreateDirectory(folderPath); } AssetExporter.Export(container, Components, filePath); SceneImporter sceneImporter = new SceneImporter(); Meta meta = new Meta(sceneImporter, GUID); ExportMeta(container, meta, filePath); string sceneName = Path.GetFileName(sceneSubPath); string subFolderPath = Path.Combine(folderPath, sceneName); if (OcclusionCullingData != null) { ExportAsset(container, OcclusionCullingData, subFolderPath); } return(true); }
protected override string ExportInner(ProjectAssetContainer container, string filePath) { if (m_convert) { string dirPath = Path.GetDirectoryName(filePath); string fileName = Path.GetFileNameWithoutExtension(filePath); filePath = $"{Path.Combine(dirPath, fileName)}.png"; } AssetExporter.Export(container, Asset, filePath); return(filePath); }
public override bool Export(ProjectAssetContainer container, string dirPath) { if (m_export.Count == 0) { return(false); } string scriptFolder = m_export[0].ExportName; string scriptPath = Path.Combine(dirPath, scriptFolder); AssetExporter.Export(container, m_export, scriptPath, OnScriptExported); return(true); }
protected void ExportAsset(ProjectAssetContainer container, IAssetImporter importer, Object asset, string path, string name) { if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string filePath = $"{Path.Combine(path, name)}.{asset.ExportExtension}"; AssetExporter.Export(container, asset, filePath); Meta meta = new Meta(importer, asset.GUID); ExportMeta(container, meta, filePath); }
protected virtual string ExportInner(ProjectAssetContainer container, string filePath) { AssetExporter.Export(container, Asset, filePath); return(filePath); }
protected override string ExportInner(ProjectAssetContainer container, string filePath) { AssetExporter.Export(container, Objects, filePath); return(filePath); }