There is a class that have data that cannot be serialized easily. But, I can prepare it to serializable form. So, is there any method to override that will be called right before serialization to prepare data?
[System.Serializable]
public MyCalss {
//Unity can serialise this list;
public List<int> serializableData;
//class contains a lot of data that cannot be serialized by Unity3D
protected override void OnSerialize() { // <-- looking for this method
//pack all my data into the serializableData array
}
}
public Behaviour: MonoBehaviour {
MyClass instanceOfMyClass; // will be serialized by Unity3D
}
OnNetworkSerialize
... Could you give a code example? – BlueRaja - Danny Pflughoeft Feb 14 '14 at 4:04