mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
parent
b0213ae1bb
commit
e6c908a6b7
@ -29,13 +29,6 @@ public interface IUnityObjectBase : IUnityAssetBase
|
||||
/// </summary>
|
||||
long PathID { get; }
|
||||
/// <summary>
|
||||
/// A random GUID for this object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This may be overridden by export code, eg for MonoScripts.
|
||||
/// </remarks>
|
||||
UnityGuid GUID { get; }
|
||||
/// <summary>
|
||||
/// The original path of this object, if known.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
||||
@ -23,7 +23,6 @@ public abstract class UnityObjectBase : UnityAssetBase, IUnityObjectBase
|
||||
public int ClassID => AssetInfo.ClassID;
|
||||
public long PathID => AssetInfo.PathID;
|
||||
public virtual string ClassName => GetType().Name;
|
||||
public UnityGuid GUID { get; } = UnityGuid.NewGuid();
|
||||
public IUnityObjectBase? MainAsset { get; set; }
|
||||
|
||||
public YamlDocument ExportYamlDocument(IExportContainer container)
|
||||
|
||||
@ -28,7 +28,7 @@ namespace AssetRipper.Export.UnityProjects
|
||||
bool result = ExportInner(container, filePath, projectDirectory);
|
||||
if (result)
|
||||
{
|
||||
Meta meta = new Meta(Asset.GUID, CreateImporter(container));
|
||||
Meta meta = new Meta(GUID, CreateImporter(container));
|
||||
ExportMeta(container, meta, filePath);
|
||||
return true;
|
||||
}
|
||||
@ -54,7 +54,7 @@ namespace AssetRipper.Export.UnityProjects
|
||||
long exportID = GetExportID(container, asset);
|
||||
return isLocal ?
|
||||
new MetaPtr(exportID) :
|
||||
new MetaPtr(exportID, Asset.GUID, AssetExporter.ToExportType(Asset));
|
||||
new MetaPtr(exportID, GUID, AssetExporter.ToExportType(Asset));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -80,6 +80,7 @@ namespace AssetRipper.Export.UnityProjects
|
||||
return importer;
|
||||
}
|
||||
|
||||
public override UnityGuid GUID { get; } = UnityGuid.NewGuid();
|
||||
public override IAssetExporter AssetExporter { get; }
|
||||
public override AssetCollection File => Asset.Collection;
|
||||
public override IEnumerable<IUnityObjectBase> Assets
|
||||
|
||||
@ -30,6 +30,8 @@ namespace AssetRipper.Export.UnityProjects
|
||||
{
|
||||
public abstract class ExportCollection : IExportCollection
|
||||
{
|
||||
public virtual UnityGuid GUID => throw new NotSupportedException();
|
||||
|
||||
protected static void ExportMeta(IExportContainer container, Meta meta, string filePath)
|
||||
{
|
||||
string metaPath = $"{filePath}{MetaExtension}";
|
||||
@ -61,7 +63,7 @@ namespace AssetRipper.Export.UnityProjects
|
||||
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(asset.GUID, importer);
|
||||
Meta meta = new Meta(GUID, importer);
|
||||
ExportMeta(container, meta, filePath);
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ namespace AssetRipper.Export.UnityProjects.Project
|
||||
{
|
||||
return new MetaPtr(
|
||||
ExportIdHandler.GetMainExportID((int)ClassIDType.PrefabInstance),
|
||||
Asset.GUID,
|
||||
GUID,
|
||||
EmitPrefabAsset ? AssetType.Serialized : AssetType.Meta);
|
||||
}
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ namespace AssetRipper.Export.UnityProjects.Project
|
||||
public override string Name => Scene.Name;
|
||||
|
||||
public override AssetCollection File => CurrentFile;
|
||||
public UnityGuid GUID => Scene.GUID;
|
||||
public override UnityGuid GUID => Scene.GUID;
|
||||
public override IAssetExporter AssetExporter { get; }
|
||||
public SceneHierarchyObject Hierarchy { get; }
|
||||
public SceneDefinition Scene => Hierarchy.Scene;
|
||||
|
||||
@ -19,11 +19,6 @@ internal sealed class DevelopmentTab(IUnityObjectBase asset) : HtmlTab
|
||||
new Th(writer).Close(Localization.CsharpType);
|
||||
new Td(writer).Close(asset.GetType().Name);
|
||||
}
|
||||
using (new Tr(writer).End())
|
||||
{
|
||||
new Th(writer).Close(Localization.Guid);
|
||||
new Td(writer).Close(asset.GUID.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user