private static void DrawFadeTooltip() { if (TooltipHelper.fadeCompleted == false) { float t = (float)(EditorApplication.timeSinceStartup - TooltipHelper.startTime) - TooltipHelper.DelayFadeIn; if (t < TooltipHelper.FadeInDuration) { if (EditorWindow.mouseOverWindow != null) { EditorWindow.mouseOverWindow.Repaint(); } } else { TooltipHelper.fadeCompleted = true; } if (t < 0F) { return; } using (ColorContentRestorer.Get(t < TooltipHelper.FadeInDuration, Color.Lerp(TooltipHelper.transparentWhite, Color.white, t / TooltipHelper.FadeInDuration))) TooltipHelper.DrawTooltip(); } else { TooltipHelper.DrawTooltip(); } }
public void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (this.errorAttribute != null) { using (ColorContentRestorer.Get(Color.black)) { EditorGUI.LabelField(position, label.text, this.errorAttribute); } } else if (this.conditionField == null || this.conditionResult == this.normalBooleanValue) { EditorGUI.BeginChangeCheck(); EditorGUI.PropertyField(position, property, label, property.isExpanded); if (EditorGUI.EndChangeCheck() == true) { this.invalidHeight = true; } } }
public static ColorContentRestorer Get(bool condition, Color color) { return(condition ? ColorContentRestorer.Get(color) : null); }