-
Notifications
You must be signed in to change notification settings - Fork 110
Getting Started: MonoBehaviour reading
nesrak1 edited this page Aug 5, 2023
·
6 revisions
AT3 makes MonoBehaviour loading trivial. First, decide what scripting backend the game uses. Only Mono and IL2CPP are supported at the moment.
If your game uses Mono, you should have many dlls in the Game/Game_Data/Managed folder. If this is the case, install AssetsTools.NET.MonoCecil
.
If your game uses Il2Cpp, you should have a global-metadata.dat in Managed (depends on platform). In this case, install AssetsTools.NET.Cpp2IL
.
After creating the AssetsManager
, you can set up MonoBehaviour deserialization with manager.SetMonoTempGenerator()
.
// mono
manager.MonoTempGenerator = new MonoCecilTempGenerator("path/to/game/managed/folder");
// il2cpp
FindCpp2IlFilesResult il2cppFiles = FindCpp2IlFiles.Find("path/to/game/_data/folder");
if (il2cppFiles.success)
{
manager.MonoTempGenerator = new Cpp2IlTempGenerator(il2cppFiles.metaPath, il2cppFiles.asmPath);
}
After that, using GetBaseField
should automatically retrieve the necessary data.