void ISerializationCallbackReceiver.OnAfterDeserialize() { // Ignore the FullSerializer callback, but still catch the Unity callback if (Serialization.isCustomSerializing) { return; } Serialization.isUnitySerializing = true; try { object @this = this; OnBeforeDeserialize(); _data.DeserializeInto(ref @this, true); OnAfterDeserialize(); UnityThread.EditorAsync(OnPostDeserializeInEditor); } catch (Exception ex) { // Don't abort the whole deserialization thread because this one object failed Debug.LogError($"Failed to deserialize scriptable object.\n{ex}", this); } Serialization.isUnitySerializing = false; }
void ISerializationCallbackReceiver.OnAfterDeserialize() { if (Serialization.isCustomSerializing) { return; } Serialization.isUnitySerializing = true; try { object @this = this; OnBeforeDeserialize(); _data.DeserializeInto(ref @this, true); OnAfterDeserialize(); } catch (Exception ex) { // Don't abort the whole deserialization thread because this one object failed Debug.LogError($"Failed to deserialize behaviour.\n{ex}", this); } Serialization.isUnitySerializing = false; }