public override ExportPointer CreateExportPointer(Object asset, bool isLocal) { if (isLocal) { throw new NotSupportedException(); } MonoScript script = m_scripts[asset]; if (s_unityEngine.IsMatch(script.AssemblyName)) { if (MonoScript.IsReadNamespace(script.File.Version)) { int fileID = Compute(script.Namespace, script.Name); return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } else { ScriptInfo scriptInfo = script.GetScriptInfo(); if (scriptInfo != default) { int fileID = Compute(scriptInfo.Namespace, scriptInfo.Name); return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } } } long exportID = GetExportID(asset); EngineGUID uniqueGUID = script.GUID; return(new ExportPointer(exportID, uniqueGUID, AssetExporter.ToExportType(asset))); }
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); }
public override ExportPointer CreateExportPointer(Object asset, bool isLocal) { string exportID = GetExportID(asset); return(isLocal ? new ExportPointer(exportID) : new ExportPointer(exportID, Asset.GUID, AssetExporter.ToExportType(Asset.ClassID))); }
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 ExportPointer CreateExportPointer(Object asset, bool isLocal) { if (isLocal) { throw new ArgumentException(nameof(isLocal)); } long exportId = GetExportID(asset); AssetType type = AssetExporter.ToExportType(asset); return(new ExportPointer(exportId, EngineGUID.MissingReference, type)); }
public ExportPointer CreateExportPointer(Object @object, bool isLocal) { if (isLocal) { throw new ArgumentException(nameof(isLocal)); } string exportId = GetExportID(@object); AssetType type = AssetExporter.ToExportType(@object.ClassID); return(new ExportPointer(exportId, UtinyGUID.MissingReference, type)); }
public override ExportPointer CreateExportPointer(Object asset, bool isLocal) { if (isLocal) { throw new NotSupportedException(); } ulong exportID = GetExportID(asset); EngineGUID uniqueGUID = m_scripts[asset].GUID; return(new ExportPointer(exportID, uniqueGUID, AssetExporter.ToExportType(asset))); }
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); }