From eb27e5fd31f73b998a4bbd85511a31e40b8c61b7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 21 十一月 2025 17:03:47 +0800
Subject: [PATCH] 0312 关闭游戏内日志
---
Main/System/Battle/UIComp/DamageLine.cs | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/Main/System/Battle/UIComp/DamageLine.cs b/Main/System/Battle/UIComp/DamageLine.cs
index 45edcab..ccac5bc 100644
--- a/Main/System/Battle/UIComp/DamageLine.cs
+++ b/Main/System/Battle/UIComp/DamageLine.cs
@@ -1,23 +1,51 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
+using UnityEngine.UI;
public class DamageLine : MonoBehaviour
{
- public TextEx damageTypeLabel;
+ public TextEx damageTypeLabel;
- public TextEx damageValueLabel;
+ public TextEx damageValueLabel;
- public void SetDamage(DamageType damageType, long damage)
+ public void SetDamage(int damageType, long damage)
{
- damageTypeLabel.SetActive(true);
- damageValueLabel.text = damage.ToString();
+ damageTypeLabel.SetActive(false);
+ damageValueLabel.text = BattleUtility.DisplayDamageNum(damage, damageType);
}
public void SetDamage(long damage)
{
- damageTypeLabel.SetActive(false);
- damageValueLabel.text = damage.ToString();
+ damageTypeLabel.SetActive(false);
+ damageValueLabel.text = damage.ToString();
+ }
+
+ public void SetDamage(BattleDmg damage)
+ {
+ 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