mirror of
https://github.com/AssetRipper/TypeTreeConversion.git
synced 2026-11-13 18:07:53 -10:00
27 lines
698 B
C#
27 lines
698 B
C#
using AssetsTools.NET;
|
|
|
|
namespace TypeTreeConversion.TextAssetExample;
|
|
|
|
public class TextAssetFieldConverter : DefaultFieldConverter
|
|
{
|
|
public TextAssetFieldConverter(ClassDatabaseFile classDatabase) : base(classDatabase)
|
|
{
|
|
}
|
|
|
|
protected override AssetTypeValueField CreateNewBaseField(int originalTypeID)
|
|
{
|
|
return base.CreateNewBaseField(49);
|
|
}
|
|
|
|
protected override void CopyFields(UnityAsset asset, AssetTypeValueField source, AssetTypeValueField destination)
|
|
{
|
|
CopyFieldsExactly(source, destination);
|
|
destination["m_Script"].AsString = $"""
|
|
This asset has been replaced with a text asset.
|
|
Type ID: {asset.TypeID}
|
|
Path ID: {asset.PathID}
|
|
Name: {asset.Name}
|
|
""";
|
|
}
|
|
}
|