public long GetExportID(Object asset) { throw new NotSupportedException(); }
public bool IsHandle(Object asset) { return(true); }
protected virtual string GetExportExtension(Object asset) { return(asset.ExportExtension); }
public ManagerExportCollection(IAssetExporter assetExporter, Object asset) : this(assetExporter, (GlobalGameManager)asset) { }
public void Export(string path, GameCollection fileCollection, IEnumerable <SerializedFile> files, ExportOptions options) { EventExportPreparationStarted?.Invoke(); VirtualSerializedFile virtualFile = new VirtualSerializedFile(options); List <IExportCollection> collections = new List <IExportCollection>(); // speed up fetching List <Object> depList = new List <Object>(); HashSet <Object> depSet = new HashSet <Object>(); HashSet <Object> queued = new HashSet <Object>(); foreach (SerializedFile file in files) { foreach (Object asset in file.FetchAssets()) { if (!options.Filter(asset)) { continue; } depList.Add(asset); depSet.Add(asset); } } for (int i = 0; i < depList.Count; i++) { Object asset = depList[i]; if (!queued.Contains(asset)) { IExportCollection collection = CreateCollection(virtualFile, asset, options); foreach (Object element in collection.Assets) { queued.Add(element); } collections.Add(collection); } if (options.ExportDependencies) { DependencyContext context = new DependencyContext(asset.File.Version, asset.File.Platform, asset.File.Flags, true); foreach (PPtr <Object> pointer in asset.FetchDependencies(context)) { if (pointer.IsNull) { continue; } Object dependency = pointer.FindAsset(asset.File); if (dependency == null) { string hierarchy = $"[{asset.File.Name}]" + asset.File.GetAssetLogString(asset.PathID) + "." + context.GetPointerPath(); Logger.Log(LogType.Warning, LogCategory.Export, $"{hierarchy}'s dependency {context.PointerName} = {pointer.ToLogString(asset.File)} wasn't found"); continue; } if (!depSet.Contains(dependency)) { depList.Add(dependency); depSet.Add(dependency); } } } } depList.Clear(); depSet.Clear(); queued.Clear(); EventExportPreparationFinished?.Invoke(); EventExportStarted?.Invoke(); ProjectAssetContainer container = new ProjectAssetContainer(this, virtualFile, fileCollection.FetchAssets(), collections, options); for (int i = 0; i < collections.Count; i++) { IExportCollection collection = collections[i]; container.CurrentCollection = collection; bool isExported = collection.Export(container, path); if (isExported) { Logger.Log(LogType.Info, LogCategory.Export, $"'{collection.Name}' exported"); } EventExportProgressUpdated?.Invoke(i, collections.Count); } EventExportFinished?.Invoke(); }
public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback) { throw new NotSupportedException("Need to export all scripts at once"); }
public bool IsHandle(Object asset, ExportOptions options) { return(true); }
public static bool AssetSelector(Object asset) { return(true); }
public override bool IsContains(Object asset) { return(m_scripts.ContainsKey(asset)); }
public Object FindAsset(ClassIDType classID, string name) { Object asset = VirtualFile.FindAsset(classID, name); return(asset ?? File.FindAsset(classID, name)); }
public void Export(IExportContainer container, Object asset, string path) { Export(container, asset, path, null); }
public Object FindAsset(ClassIDType classID) { Object asset = VirtualFile.FindAsset(classID); return(asset ?? File.FindAsset(classID)); }
protected void ExportAsset(ProjectAssetContainer container, IAssetImporter importer, Object asset, string path, string name) { if (!DirectoryUtils.Exists(path)) { DirectoryUtils.CreateVirtualDirectory(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); }
public EngineGUID GetExportGUID(Object asset) { throw new NotSupportedException(); }
public IExportCollection CreateCollection(VirtualSerializedFile virtualFile, Object asset) { return(new ScriptExportCollection(this, (MonoScript)asset)); }
public override long GetExportID(Object asset) { return(GetMainExportID(asset)); }
public bool Export(IExportContainer container, Object asset, string path) { throw new NotSupportedException("Need to export all scripts at once"); }
public static long GetMainExportID(Object asset) { return(GetMainExportID((uint)asset.ClassID, 0)); }
public AssetType ToExportType(Object asset) { return(AssetType.Meta); }
public static long GetMainExportID(Object asset, uint value) { return(GetMainExportID((uint)asset.ClassID, value)); }
public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback) { Export(container, asset, path); callback?.Invoke(container, asset, path); }
public abstract bool IsContains(Object asset);
public override ExportPointer CreateExportPointer(Object asset, bool isLocal) { throw new NotSupportedException(); }
public abstract long GetExportID(Object asset);
public AssetType ToExportType(Object asset) { ToUnknownExportType(asset.ClassID, out AssetType assetType); return(assetType); }
public abstract ExportPointer CreateExportPointer(Object asset, bool isLocal);
public IExportCollection CreateCollection(VirtualSerializedFile virtualFile, Object asset) { return(new AudioExportCollection(this, (AudioClip)asset)); }
protected void ExportAsset(ProjectAssetContainer container, IAssetImporter importer, Object asset, string path, string name) { if (!DirectoryUtils.Exists(path)) { DirectoryUtils.CreateVirtualDirectory(path); } string fullName = $"{name}.{GetExportExtension(asset)}"; string uniqueName = FileUtils.GetUniqueName(path, fullName, FileUtils.MaxFileNameLength - MetaExtension.Length); string filePath = Path.Combine(path, uniqueName); AssetExporter.Export(container, asset, filePath); Meta meta = new Meta(importer, asset.GUID); ExportMeta(container, meta, filePath); }
protected virtual string AddExportExtension(string assetPath, Object asset) { var exportExtension = GetExportExtension(asset); return(string.IsNullOrWhiteSpace(exportExtension) ? assetPath : $"{assetPath}.{exportExtension}"); }
public bool IsContains(Object asset) { return(false); }