You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
845 B

using UnityEditorInternal;
namespace UnityEditor.Rendering
{
class AdvancedPropertiesObserver
{
[InitializeOnLoadMethod]
static void SubscribeToAdvancedPropertiesChanges()
{
AdvancedProperties.advancedPreferenceChanged += OnShowAdvancedPropertiesChanged;
}
static void OnShowAdvancedPropertiesChanged(bool newValue)
{
if (newValue)
{
AdvancedProperties.ResetHighlight();
EditorApplication.update += RepaintUntilAnimFinish;
}
}
static void RepaintUntilAnimFinish()
{
if (AdvancedProperties.IsHighlightActive())
InternalEditorUtility.RepaintAllViews();
else
EditorApplication.update -= RepaintUntilAnimFinish;
}
}
}