public virtual void Apply(Selectable item)
            {
                Selectable.Transition transition = this._transition;
                bool flag = item.get_transition() != transition;

                item.set_transition(transition);
                ICustomSelectable customSelectable = item as ICustomSelectable;

                if (transition == 1)
                {
                    ThemeSettings.CustomColorBlock colors = this._colors;
                    colors.fadeDuration = 0.0f;
                    item.set_colors((ColorBlock)colors);
                    colors.fadeDuration = this._colors.fadeDuration;
                    item.set_colors((ColorBlock)colors);
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedColor = colors.disabledHighlightedColor;
                    }
                }
                else if (transition == 2)
                {
                    item.set_spriteState((SpriteState)this._spriteState);
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedSprite = this._spriteState.disabledHighlightedSprite;
                    }
                }
                else if (transition == 3)
                {
                    item.get_animationTriggers().set_disabledTrigger(this._animationTriggers.disabledTrigger);
                    item.get_animationTriggers().set_highlightedTrigger(this._animationTriggers.highlightedTrigger);
                    item.get_animationTriggers().set_normalTrigger(this._animationTriggers.normalTrigger);
                    item.get_animationTriggers().set_pressedTrigger(this._animationTriggers.pressedTrigger);
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedTrigger = this._animationTriggers.disabledHighlightedTrigger;
                    }
                }
                if (!flag)
                {
                    return;
                }
                item.get_targetGraphic().CrossFadeColor(item.get_targetGraphic().get_color(), 0.0f, true, true);
            }
示例#2
0
            public virtual void Apply(Selectable item)
            {
                Selectable.Transition transition = this._transition;
                bool flag = item.transition != transition;

                item.transition = transition;
                ICustomSelectable customSelectable = item as ICustomSelectable;

                if (transition == Selectable.Transition.ColorTint)
                {
                    ThemeSettings.CustomColorBlock colors = this._colors;
                    colors.fadeDuration = 0f;
                    item.colors         = colors;
                    colors.fadeDuration = this._colors.fadeDuration;
                    item.colors         = colors;
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedColor = colors.disabledHighlightedColor;
                    }
                }
                else if (transition == Selectable.Transition.SpriteSwap)
                {
                    item.spriteState = this._spriteState;
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedSprite = this._spriteState.disabledHighlightedSprite;
                    }
                }
                else if (transition == Selectable.Transition.Animation)
                {
                    item.animationTriggers.disabledTrigger    = this._animationTriggers.disabledTrigger;
                    item.animationTriggers.highlightedTrigger = this._animationTriggers.highlightedTrigger;
                    item.animationTriggers.normalTrigger      = this._animationTriggers.normalTrigger;
                    item.animationTriggers.pressedTrigger     = this._animationTriggers.pressedTrigger;
                    if (customSelectable != null)
                    {
                        customSelectable.disabledHighlightedTrigger = this._animationTriggers.disabledHighlightedTrigger;
                    }
                }
                if (flag)
                {
                    item.targetGraphic.CrossFadeColor(item.targetGraphic.color, 0f, true, true);
                }
            }