Example #1
0
        // 新品质颜色
        public static string FormatStringWithinQualityColor(RoleQuality roleQuality, string str)
        {
            string formatString = string.Empty;

            switch (roleQuality)
            {
            case RoleQuality.White:
                formatString = Localization.Get("common.quality.csharp_formt_string.white");
                break;

            case RoleQuality.Green:
                formatString = Localization.Get("common.quality.csharp_formt_string.green");
                break;

            case RoleQuality.Blue:
                formatString = Localization.Get("common.quality.csharp_formt_string.blue");
                break;

            case RoleQuality.Purple:
                formatString = Localization.Get("common.quality.csharp_formt_string.purple");
                break;

            case RoleQuality.Orange:
                formatString = Localization.Get("common.quality.csharp_formt_string.orange");
                break;

            case RoleQuality.Red:
                formatString = Localization.Get("common.quality.csharp_formt_string.orange");
                break;

            default:
                formatString = Localization.Get("common.quality.csharp_formt_string.white");
                break;
            }
            return(string.Format(formatString, str));
        }
Example #2
0
        public static Sprite GetRoleQualityFrameSprite(RoleQuality roleQuality)
        {
            string roleQualityFrameSpritePath = string.Empty;

            switch (roleQuality)
            {
            case RoleQuality.White:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02");
                break;

            case RoleQuality.Green:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02_lv1");
                break;

            case RoleQuality.Blue:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02_lv2");
                break;

            case RoleQuality.Purple:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02_lv3");
                break;

            case RoleQuality.Orange:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02_lv4");
                break;

            case RoleQuality.Red:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02_lv4");
                break;

            default:
                roleQualityFrameSpritePath = Path.Combine(ROLE_QUALITY_FRAME_SPRITE_PATH, "ui_items_02");
                break;
            }
            return(ResMgr.instance.Load <Sprite>(roleQualityFrameSpritePath));
        }