Exemple #1
0
        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();
            }
        }
Exemple #2
0
        public static ColorContentRestorer      Get(Color color)
        {
            ColorContentRestorer restorer;

            if (ColorContentRestorer.cached.TryGetValue(color, out restorer) == false)
            {
                restorer = new ColorContentRestorer(color);

                ColorContentRestorer.cached.Add(color, restorer);
            }
            else
            {
                restorer.Set(color);
            }

            return(restorer);
        }
Exemple #3
0
 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;
         }
     }
 }
Exemple #4
0
 public ColorContentAnimator(UnityAction update, float value, float target) : base(update, value, target)
 {
     this.restorer = new ColorContentRestorer();
 }
Exemple #5
0
 public static ColorContentRestorer      Get(bool condition, Color color)
 {
     return(condition ? ColorContentRestorer.Get(color) : null);
 }