From 4e41975b0c62fa10ab571b0c9ad0690754762b6a Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 30 十月 2025 16:45:07 +0800
Subject: [PATCH] 125 战斗 飘字更新

---
 Main/System/Battle/UIComp/DamageLine.cs |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/Main/System/Battle/UIComp/DamageLine.cs b/Main/System/Battle/UIComp/DamageLine.cs
index 3f37cd5..ccac5bc 100644
--- a/Main/System/Battle/UIComp/DamageLine.cs
+++ b/Main/System/Battle/UIComp/DamageLine.cs
@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.UI;
 
 public class DamageLine : MonoBehaviour
 {
@@ -26,4 +27,25 @@
         damageTypeLabel.SetActive(false);
         damageValueLabel.text = BattleUtility.DisplayDamageNum(damage);
     }
+
+    public void SetColor(Color color)
+    {
+        var text = GetComponent<Text>();
+        if (text != null)
+        {
+            text.color = color;
+        }
+
+        var texts = GetComponentsInChildren<Text>();
+        foreach (var t in texts)
+        {
+            t.color = color;
+        }
+
+        var images = GetComponentsInChildren<Image>();
+        foreach (var img in images)
+        {
+            img.color = color;
+        }
+    }
 }

--
Gitblit v1.8.0