Custom coding
Last updated
Last updated
It is possible to have custom scripts inside your mod. For that, you will need to setup a new DLL and tied to Everhood 2 and Unity.
You'll have access to all of Unity's features and can create a script that can be dragged into the inspector by having it inherit from MonoBehaviour.
You can also access classes from Everhood 2 that you can explore and analyze using dnSpy and sinai-dev/UnityExplorer.
To update the dll build the project and replace the dll using file explorer, Unity will do the rest.
While you can access game scripts within methods, parameters, attributes etc.
You specifically cannot store the reference of game scripts within a class as Unity will then attempt to serialize them even if you mark them as [NonSerializable]
which will break the DLL.
This will not work:
The workaround is to store the reference as "object" like this and then Cast it back to the target class:
Then Cast, an efficient method could be for example: