From 8f56204fdd6f7c5c3b9bf6752e103db7124d1e2b Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 14 五月 2026 19:57:59 +0800
Subject: [PATCH] 592 多语言适配 英语时OutlineEx描边宽度减半,其他语言保持原值
---
Main/Component/UI/Core/OutlineEx.cs | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/Main/Component/UI/Core/OutlineEx.cs b/Main/Component/UI/Core/OutlineEx.cs
index 54ec2ff..de7cfe9 100644
--- a/Main/Component/UI/Core/OutlineEx.cs
+++ b/Main/Component/UI/Core/OutlineEx.cs
@@ -37,7 +37,19 @@
[Range(0, 30)]
//榛樿10锛屼笉鍚岀殑棰滆壊锛堝寘鎷皟鏁碼lpha锛夎瑙変笂鎻忚竟绮楃粏鏈夊樊寮傦紝鏁卻hader閲屼箻浠�0.2閫傚簲涓嶅悓鎯呭喌
- public int OutlineWidth = 10;
+ public int OutlineWidth = 10;
+
+ //澶氳瑷�閫傞厤锛氳嫳璇椂鎻忚竟瀹藉害鍑忓崐锛屽叾浠栬瑷�淇濇寔鍘熷��
+ private int EffectiveOutlineWidth
+ {
+ get
+ {
+ string langId = Language.Id;
+ if (langId == "en")
+ return OutlineWidth / 2;
+ return OutlineWidth;
+ }
+ }
private List<UIVertex> m_VetexList = new List<UIVertex>();
@@ -207,18 +219,18 @@
//OutlineColor 鍜� OutlineWidth 涔熶紶鍏ワ紝閬垮厤鍑虹幇涓嶅悓鐨勬潗璐ㄧ悆
var col_rg = new Vector2(OutlineColor.r, OutlineColor.g); //鎻忚竟棰滆壊 鐢╱v3 鍜� tangent鐨� zw浼犻��
var col_ba = new Vector4(0,0,OutlineColor.b, OutlineColor.a);
- var normal = new Vector3(0, 0, OutlineWidth); //鎻忚竟鐨勫搴� 鐢╪ormal鐨剒浼犻��
+ var normal = new Vector3(0, 0, EffectiveOutlineWidth); //鎻忚竟鐨勫搴� 鐢╪ormal鐨剒浼犻��
// 涓烘瘡涓《鐐硅缃柊鐨凱osition鍜孶V锛屽苟浼犲叆鍘熷UV妗�
- v1 = _SetNewPosAndUV(v1, this.OutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
+ v1 = _SetNewPosAndUV(v1, EffectiveOutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
v1.uv3 = col_rg;
v1.tangent = col_ba;
v1.normal = normal;
- v2 = _SetNewPosAndUV(v2, this.OutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
+ v2 = _SetNewPosAndUV(v2, EffectiveOutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
v2.uv3 = col_rg;
v2.tangent = col_ba;
v2.normal = normal;
- v3 = _SetNewPosAndUV(v3, this.OutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
+ v3 = _SetNewPosAndUV(v3, EffectiveOutlineWidth, posCenter, triX, triY, uvX, uvY, uvMin, uvMax);
v3.uv3 = col_rg;
v3.tangent = col_ba;
v3.normal = normal;
--
Gitblit v1.8.0