From ca9bf59c053215ddd3568ddabceb574f333b1709 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 19:08:35 +0800
Subject: [PATCH] 125 战斗 飘字曲线应用提交
---
Main/System/Battle/UIComp/BattleFloatingUIController.cs | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/Main/System/Battle/UIComp/BattleFloatingUIController.cs b/Main/System/Battle/UIComp/BattleFloatingUIController.cs
index e67c50d..a881ff4 100644
--- a/Main/System/Battle/UIComp/BattleFloatingUIController.cs
+++ b/Main/System/Battle/UIComp/BattleFloatingUIController.cs
@@ -237,8 +237,10 @@
/// </summary>
private void UpdatePosition()
{
- float moveProgress = timer / config.totalShowTime;
- Vector2 currentPos = Vector2.Lerp(GetBeginPosition(), GetEndPosition(), moveProgress);
+ float timeProgress = timer / config.totalShowTime;
+ // 浣跨敤鏇茬嚎鏉ヨ皟鏁存彃鍊艰繘搴�
+ float curveProgress = config.positionCurve.Evaluate(timeProgress);
+ Vector2 currentPos = Vector2.Lerp(GetBeginPosition(), GetEndPosition(), curveProgress);
rectTransform.anchoredPosition = currentPos;
}
@@ -266,14 +268,16 @@
// 闃舵1: 缂╂斁鍜岄�忔槑搴﹀彉鍖�
if (timer < config.scaleChangeTime)
{
- float progress = timer / config.scaleChangeTime;
+ float timeProgress = timer / config.scaleChangeTime;
- // 缂╂斁鎻掑��
- Vector3 currentScale = Vector3.Lerp(GetBeginScale(), GetEndScale(), progress);
+ // 浣跨敤鏇茬嚎鏉ヨ皟鏁寸缉鏀炬彃鍊艰繘搴�
+ float scaleProgress = config.scaleCurve.Evaluate(timeProgress);
+ Vector3 currentScale = Vector3.Lerp(GetBeginScale(), GetEndScale(), scaleProgress);
rectTransform.localScale = currentScale * scaleRatio;
- // 棰滆壊鎻掑�硷紙浣跨敤杩愯鏃堕鑹叉垨閰嶇疆棰滆壊锛�
- Color currentColor = Color.Lerp(GetBeginColor(), GetEndColor(), progress);
+ // 浣跨敤鏇茬嚎鏉ヨ皟鏁撮鑹叉彃鍊艰繘搴�
+ float colorProgress = config.colorCurve.Evaluate(timeProgress);
+ Color currentColor = Color.Lerp(GetBeginColor(), GetEndColor(), colorProgress);
applyColorCallback?.Invoke(currentColor);
}
// 闃舵2: 淇濇寔鏈�缁堢缉鏀惧拰閫忔槑搴�
--
Gitblit v1.8.0