From 62188b271cce5e3aec5ca40d58c30f08643e2f60 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 04 九月 2025 23:20:17 +0800
Subject: [PATCH] 117 【武将】武将系统 - 天赋部分,优化自动战斗
---
Main/Utility/UIHelper.cs | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 6e47226..84dc837 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -761,6 +761,30 @@
return msg;
}
+ public static string AppendColor(Color color, string msg)
+ {
+ return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>");
+ }
+
+
+ public static string ColorToHexWithHash(Color color, bool includeAlpha = false)
+ {
+ int r = Mathf.RoundToInt(color.r * 255);
+ int g = Mathf.RoundToInt(color.g * 255);
+ int b = Mathf.RoundToInt(color.b * 255);
+ if (includeAlpha)
+ {
+ int a = Mathf.RoundToInt(color.a * 255);
+ return string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", r, g, b, a);
+ }
+ else
+ {
+ return string.Format("{0:X2}{1:X2}{2:X2}", r, g, b);
+ }
+ }
+
+
+
//needName 鎸囧畼鑱�0鏄惁闇�瑕佸悕绉�
public static string GetRealmName(int realmLv, bool bright = true, bool needName = false)
{
@@ -825,7 +849,7 @@
/// <param name="itemColor"></param>
/// <param name="msg"></param>
/// <param name="bright"></param>
- /// <param name="colorGroupType"></param>
+ /// <param name="colorGroupType">0 閫氱敤鍔熻兘鍝佽川鍒嗙粍绮捐壇鍒扮璇�</param>
/// <returns></returns>
public static string AppendColor(int itemColor, string msg, bool bright = true, int colorGroupType = 0)
{
--
Gitblit v1.8.0