From ed98029a88cd89702980ac7c40b711afddc5aeb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 14:44:59 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
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