UI系统优化
This commit is contained in:
@@ -92,9 +92,9 @@ namespace BaseGames.UI
|
||||
|
||||
SetAnchoredPosition(startWorld + new Vector2(0, _floatDistance * t));
|
||||
|
||||
// alpha 淡出(后半段开始)
|
||||
_text.color = new Color(color.r, color.g, color.b,
|
||||
Mathf.Lerp(startAlpha, 0f, Mathf.Clamp01((t - 0.5f) / 0.5f)));
|
||||
// alpha 淡出(后半段开始)—— 修改 struct 的 a 分量并回写,避免每帧 new Color 堆分配
|
||||
color.a = Mathf.Lerp(startAlpha, 0f, Mathf.Clamp01((t - 0.5f) / 0.5f));
|
||||
_text.color = color;
|
||||
|
||||
elapsed += Time.deltaTime;
|
||||
yield return null;
|
||||
|
||||
Reference in New Issue
Block a user