using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class DamageLine : MonoBehaviour
|
{
|
|
public TextEx damageTypeLabel;
|
|
public TextEx damageValueLabel;
|
|
public void SetDamage(int damageType, long damage)
|
{
|
damageTypeLabel.SetActive(false);
|
damageValueLabel.text = BattleUtility.DisplayDamageNum(damage, damageType);
|
}
|
|
public void SetDamage(long damage)
|
{
|
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;
|
}
|
}
|
}
|