void OnEnable()
        {
            if (profile == null)
            {
                profile = new DiffusionProfile(true);
            }

            profile.Validate();
            UpdateCache();

#if UNITY_EDITOR
            if (m_Version != Version.Last)
            {
                TryToUpgrade();
            }
            UnityEditor.Rendering.HighDefinition.DiffusionProfileHashTable.UpdateDiffusionProfileHashNow(this);
#endif
        }
Esempio n. 2
0
        void OnEnable()
        {
            if (profile == null)
            {
                profile = new DiffusionProfile(true);
            }

            profile.Validate();
            UpdateCache();

#if UNITY_EDITOR
            if (m_Version != MigrationDescription.LastVersion <Version>())
            {
                // We delay the upgrade of the diffusion profile because in the OnEnable we are still
                // in the import of the current diffusion profile, so we can't create new assets of the same
                // type from here otherwise it will freeze the editor in an infinite import loop.
                // Thus we delay the upgrade of one editor frame so the import of this asset is finished.
                UnityEditor.EditorApplication.delayCall += TryToUpgrade;
            }

            UnityEditor.Rendering.HighDefinition.DiffusionProfileHashTable.UpdateDiffusionProfileHashNow(this);
#endif
        }