From f094a749ee831f449d6cbe70ba60ad6c6717b2e2 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 13 五月 2026 20:03:50 +0800
Subject: [PATCH] 592 多语言适配 ImageLanguageAdapter增加防护,纹理不可读或未使用 Crunch 压缩时跳过纹理赋值
---
Main/Component/UI/Core/ImageLanguageAdapter.cs | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/Main/Component/UI/Core/ImageLanguageAdapter.cs b/Main/Component/UI/Core/ImageLanguageAdapter.cs
index be81e62..1fff17a 100644
--- a/Main/Component/UI/Core/ImageLanguageAdapter.cs
+++ b/Main/Component/UI/Core/ImageLanguageAdapter.cs
@@ -75,7 +75,14 @@
img.fillAmount = fillAmount;
img.fillOrigin = fillOrigin;
img.preserveAspect = preserveAspect;
- img.alphaHitTestMinimumThreshold = alphaHitTestMinimumThreshold;
+ try
+ {
+ img.alphaHitTestMinimumThreshold = alphaHitTestMinimumThreshold;
+ }
+ catch (InvalidOperationException)
+ {
+ // 绾圭悊涓嶅彲璇绘垨鏈娇鐢� Crunch 鍘嬬缉鏃惰烦杩囷紝杩欐槸 Unity 鍐呴儴闄愬埗
+ }
img.useSpriteMesh = useSpriteMesh;
img.pixelsPerUnitMultiplier = pixelsPerUnitMultiplier;
}
--
Gitblit v1.8.0