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;
        }
Пример #2
0
        private static void RuntimeInitializeOnLoadBeforeSceneLoad()
        {
            UnityThread.RuntimeInitialize();

            Ensure.OnRuntimeMethodLoad();

            Recursion.OnRuntimeMethodLoad();

            OptimizedReflection.OnRuntimeMethodLoad();

            SavedVariables.OnEnterPlayMode();

            ApplicationVariables.OnEnterPlayMode();

            ReferenceCollector.Initialize();
        }