AssetsTools.NET icon indicating copy to clipboard operation
AssetsTools.NET copied to clipboard

[Question] Are there any ready-made solutions for generating wrapper code?

Open Albeoris opened this issue 2 years ago • 1 comments

Hi! I need to dump information about databases that are described as SerializableObject and stored in game bundles.

Now I'm describing my own class hierarchy, like this:

public sealed class Conversations : UMonoBehaviour, IWrapper<Conversations>
{
    public Conversations(AssetsFileInstance assetsFile, AssetTypeValueField field) : base(assetsFile, field)
    {
    }
    
    public static Conversations Wrap(AssetsFileInstance instance, AssetTypeValueField field) => new(instance, field);
    
    public UArray<Dialogue> Dialogues => _field["dialogues"].AsArray<Dialogue>(_assetsFile);
}

Is there a ready-made solution that will generate wrapper code around AssetTypeValueField or allow me to use classes from restored DummyDll when reading assets?

Albeoris avatar Nov 26 '23 14:11 Albeoris

A proof of concept for this existed for a little bit for a modding project I worked on, but I doubt I still have the code to do it. I would also like this some day.

nesrak1 avatar Nov 27 '23 15:11 nesrak1