yyl
5 天以前 ca9bf59c053215ddd3568ddabceb574f333b1709
125 战斗 飘字曲线应用提交
1个文件已修改
18 ■■■■■ 已修改文件
Main/System/Battle/UIComp/BattleFloatingUIController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: 保持最终缩放和透明度