From 670efd8ec4d3ea430f264afed8e99ebf3ad5a759 Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Wed, 2 Jul 2025 10:09:34 +0200 Subject: [PATCH] assetstools backend: include base monobehaviour fields --- .../AssetsTools/AssetsToolsGenerator.cs | 67 +++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/TypeTreeGeneratorAPI/TypeTreeGenerator/AssetsTools/AssetsToolsGenerator.cs b/TypeTreeGeneratorAPI/TypeTreeGenerator/AssetsTools/AssetsToolsGenerator.cs index 3591087..41d509c 100644 --- a/TypeTreeGeneratorAPI/TypeTreeGenerator/AssetsTools/AssetsToolsGenerator.cs +++ b/TypeTreeGeneratorAPI/TypeTreeGenerator/AssetsTools/AssetsToolsGenerator.cs @@ -47,10 +47,69 @@ public AssetsToolsGenerator(string unityVersionString) : base(unityVersionString Name = "Base", Type = className, ValueType = AssetValueType.None, - IsArray = false, - IsAligned = false, - HasValue = false, - Children = new List(0) + Children = [ + new AssetTypeTemplateField { + Name = "m_GameObject", + Type = "PPtr", + Children = [ + new AssetTypeTemplateField { + Name = "m_FileID", + Type = "int", + Children = [], + }, + new AssetTypeTemplateField { + Name = "m_PathID", + Type = "SInt64", + Children = [], + }, + ], + }, + new AssetTypeTemplateField { + Name = "m_Enabled", + Type = "UInt8", + IsAligned = true, + Children = [], + }, + new AssetTypeTemplateField { + Name = "m_Script", + Type = "PPtr", + Children = [ + new AssetTypeTemplateField { + Name = "m_FileID", + Type = "int", + Children = [], + }, + new AssetTypeTemplateField { + Name = "m_PathID", + Type = "SInt64", + Children = [], + }, + ], + }, + new AssetTypeTemplateField { + Name = "m_Name", + Type = "string", + Children = [ + new AssetTypeTemplateField { + Name = "Array", + Type = "Array", + IsAligned = true, + Children = [ + new AssetTypeTemplateField { + Name = "size", + Type = "int", + Children = [], + }, + new AssetTypeTemplateField { + Name = "data", + Type = "char", + Children = [], + }, + ], + }, + ], + }, + ], }; IMonoBehaviourTemplateGeneratorPatch monoTemplateGenerator = monoLoaded ? monoCecilGenerator : cpp2IlGenerator;