private void CheckCharmRank(int _rank)
 {
     this.theLabel.gradientTop    = Color.white;
     this.theLabel.gradientBottom = Color.white;
     this.theLabel.color          = Color.white;
     if (_rank > 0 && _rank <= 5)
     {
         this.recordStyle = ELabelStyle.Season1_Rainbow;
     }
     else if (_rank >= 6 && _rank <= 15)
     {
         this.recordStyle = ELabelStyle.Season1_Orange;
     }
     else if (_rank >= 16 && _rank <= 30)
     {
         this.recordStyle = ELabelStyle.Season1_Purple;
     }
     else if (_rank >= 31 && _rank <= 50)
     {
         this.recordStyle = ELabelStyle.Season1_Blue;
     }
     else
     {
         this.recordStyle = ELabelStyle.None;
     }
 }
 public void Refresh(ELabelStyle _style)
 {
     if (_style == this.recordStyleRecord)
     {
         return;
     }
     this.ApplyStyle(_style);
 }
 private void ApplyStyle(ELabelStyle style)
 {
     if (style == ELabelStyle.None)
     {
         this.ApplyStoredStyle();
         return;
     }
     ToolsFacade.Instance.ApplyLabelStyle(this.theLabel, style);
     this.recordStyleRecord = style;
 }
 private void FriendApplyStyle(ELabelStyle style)
 {
     if (style == ELabelStyle.None)
     {
         this.theLabel.applyGradient = false;
         this.theLabel.color         = Color.white;
         return;
     }
     ToolsFacade.Instance.ApplyLabelStyle(this.theLabel, style);
     this.recordStyleRecord = style;
 }
    public static void ApplyLabelStyle(this ToolsFacade facade, UILabel targetLabel, ELabelStyle style)
    {
        BaseLabelStylePreset gradientPreset = LabelStylePresetFactory.GetGradientPreset(style);

        if (gradientPreset is AllochroicPreset)
        {
            Tools_LabelStyle._ApplyTweenGradient(targetLabel, gradientPreset as AllochroicPreset);
            return;
        }
        if (gradientPreset is ColorPreset)
        {
            Tools_LabelStyle._ApplyColor(targetLabel, gradientPreset as ColorPreset);
        }
        else if (gradientPreset is GradientPreset)
        {
            Tools_LabelStyle._ApplyGradient(targetLabel, gradientPreset as GradientPreset);
        }
        if (targetLabel.GetComponent <TweenGradient>() != null)
        {
            UnityEngine.Object.Destroy(targetLabel.GetComponent <TweenGradient>());
        }
    }
    public static BaseLabelStylePreset GetGradientPreset(ELabelStyle style)
    {
        switch (style)
        {
        case ELabelStyle.Season1_Orange:
            return(new GradientPreset_Season1Orange());

        case ELabelStyle.Season1_Purple:
            return(new GradientPreset_Season1Purple());

        case ELabelStyle.Season1_Blue:
            return(new GradientPreset_Season1Blue());

        case ELabelStyle.Season1_Rainbow:
            return(new AllochroicPreset_Rainbow());

        case ELabelStyle.RainbowTest:
            return(new AllochroicPreset_RainbowForTest());

        default:
            return(new ColorPreset(Color.white));
        }
    }