ZeroFormatter icon indicating copy to clipboard operation
ZeroFormatter copied to clipboard

Is ZeroFomatter can be used now on other platforms, than Windows, on the development machine?

Open Syjgin opened this issue 4 years ago • 0 comments

I'm trying to migrate from Unity binary serializer on the linux host, as it's described on the quick start guide: I replaced all [Serializable] annotations with [ZeroFormattable], and all fields with virtual properties. But after all, when I tried to serialize class to file, there are following error:

InvalidOperationException: Type is not supported, please register SaveFilesList ZeroFormatter.Formatters.ErrorFormatter2[TTypeResolver,T].Serialize (System.Byte[]& bytes, System.Int32 offset, T value) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (System.Byte[]& buffer, System.Int32 offset, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (System.IO.Stream stream, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer.Serialize[T] (System.IO.Stream stream, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0) Data.LoadSaveSystem.WriteObjectToBinaryFormatter[T] (System.String path, T object2Write) (at Assets/Scripts/Data/LoadSaveSystem.cs:329) UnityEngine.Debug:LogException(Exception) DebugUtils.DebugLogger:LogException(Exception) (at Assets/Scripts/DebugUtils/DebugLogger.cs:29) Data.LoadSaveSystem:WriteObjectToBinaryFormatter(String, SaveFilesList) (at Assets/Scripts/Data/LoadSaveSystem.cs:333) Data.LoadSaveSystem:UpdateCurrentSavesIndex(List`1) (at Assets/Scripts/Data/LoadSaveSystem.cs:346) Data.<LoadSavesDataCoroutine>d__3:MoveNext() (at Assets/Scripts/Data/LoadSaveSystem.cs:77) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

class itself is described as follows: [ZeroFormattable] public class SaveFilesList { [Index(0)] public IList<SaveFileDescription> Saves; }

Child object:

[ZeroFormattable] public class SaveFileDescription { [Index(0)] public virtual string Name { get; set; } [Index(1)] public virtual long Date { get; set; } [Index(2)] public virtual string SaveFile { get; set; } [Index(3)] public virtual bool IsProtected { get; set; } }

For register this class in the zeroFormatter, I have to run zfc.exe, which can be run only on the Windows, for now? Or there are some misconfiguration? In the first case, it's better to describe more cleanly in the guide, that this tool can be used on the Windows host only

Syjgin avatar Nov 18 '21 20:11 Syjgin