You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found some Unity types such as Vector3, Quaternion, ... does not support serialization, while we need to serialize them.
So, it is good idea to make an serializable version of them. for example Vector3Serializable.
Here is a simple example using SerializableAttribute: (Have a look at examples link at below to get idea)
usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;[Serializable]publicstructVector3Serializable{publicfloatx;publicfloaty;publicfloatz;// Place Constructors// Do implicit conversion between Vector3 and Vector3Serializable}
Hi.
I have found some Unity types such as Vector3, Quaternion, ... does not support serialization, while we need to serialize them.
So, it is good idea to make an serializable version of them. for example Vector3Serializable.
Here is a simple example using SerializableAttribute: (Have a look at examples link at below to get idea)
Or by using ISerializable interface.
Now, the list of types that we can make:
Also, we can add some more serializable custom types such as SerializableDictionary, SerializableCollection or SerializableList.
Or even some custom classes such MyCustomType.
Also there might be some unserializable types in System types.
Thanks.
The text was updated successfully, but these errors were encountered: