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)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public struct Vector3Serializable {
public float x;
public float y;
public float z;
// 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.