public string GetExportID(UtinyRipper.Classes.Object @object) { if (@object == m_asset) { return($"{(int)m_asset.ClassID}00000"); } throw new ArgumentException(nameof(@object)); }
public NativeFormatImporter(UtinyRipper.Classes.Object mainObject) { if (mainObject == null) { throw new ArgumentNullException(nameof(mainObject)); } m_mainObject = mainObject; }
public ExportPointer CreateExportPointer(UtinyRipper.Classes.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 IExportCollection CreateCollection(UtinyRipper.Classes.Object @object) { switch (@object.ClassID) { case ClassIDType.Texture2D: case ClassIDType.Cubemap: return(new TextureExportCollection(this, @object)); default: return(new AssetExportCollection(this, @object)); } }
private void ExportYAML(IAssetsExporter exporter, UtinyRipper.Classes.Object asset, string path) { using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter streamWriter = new StreamWriter(fileStream)) { YAMLWriter writer = new YAMLWriter(); exporter.File = asset.File; YAMLDocument doc = asset.ExportYAMLDocument(exporter); writer.AddDocument(doc); writer.Write(streamWriter); } } }
public SkipExportCollection(DummyAssetExporter assetExporter, UtinyRipper.Classes.Object asset, string name) { if (assetExporter == null) { throw new ArgumentNullException(nameof(assetExporter)); } if (asset == null) { throw new ArgumentNullException(nameof(asset)); } if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(nameof(name)); } AssetExporter = assetExporter; Name = name; m_asset = asset; }
protected string GetUniqueFileName(UtinyRipper.Classes.Object @object, string dirPath) { string fileName; switch (@object) { case NamedObject named: fileName = named.Name; break; case Prefab prefab: fileName = prefab.GetName(); break; default: fileName = @object.GetType().Name; break; } fileName = FixName(fileName); fileName = DirectoryUtils.GetMaxIndexName(dirPath, fileName); fileName = $"{fileName}.{@object.ExportExtension}"; return(fileName); }
public ExportPointer CreateExportPointer(UtinyRipper.Classes.Object @object, bool isLocal) { throw new NotSupportedException(); }
public string GetExportID(UtinyRipper.Classes.Object @object) { throw new NotSupportedException(); }
public bool IsContains(UtinyRipper.Classes.Object @object) { return(false); }
public bool IsContains(UtinyRipper.Classes.Object @object) { return(@object == m_asset); }
public abstract IExportCollection CreateCollection(UtinyRipper.Classes.Object @object);