I am new here (I posted the in the wrong subforum before x_X)
EDIT: Solved. I used a C# feature which apparently works in Unity 2019 but ofc not with FsSerializer...
I created a class inheriting from MobilePersonAsset and added it as a component to a Prefab called MobilePersonAsset, like explained here: https://www.dfworkshop.net/projects/dag ... son-assets
It all works pretty well, but when running the mod outside of the Unity Editor I get these error messages:
Code: Select all
Deserialization of MobilePersonAsset from TestMod failed with messages:
Failed to find type MyCustomMobilePerson.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
Failed to retrieve MobilePersonAsset component from GameObject.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
I already removed the namespace but that doesn't seem to be the error. Maybe the [ImportedComponent] Attribute is the culprit or me not knowing about a special rule regarding the serialization of Components added via the editor?
Edit:
Okay I found the issue, after deleting a lot of my code and debugging with the build mod inside Unity I got it down to this error message (I don't really know why though) and the mod loading:
Code: Select all
Ignoring type specifier; a field/property of type MyCustomMobilePerson cannot hold an instance of MyCustomMobilePerson
Code: Select all
if (ModManager.Instance && ModManager.Instance.TryGetAsset(prefabName, true, out GameObject prefab3D))
The error gets thrown in fsSerializer.TryDeserialize() in ImportedComponentAttribute.cs when using TryGetAsset(). I am not familiar with FsSerializer and why it has a problem with the content of my method while deserializing. x_X