fgm24/Assets/Scripts/UI/DamageText.cs

17 lines
407 B
C#
Raw Normal View History

2024-02-04 01:25:59 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class DamageText : MonoBehaviour
{
[SerializeField] AnimationCurve damageToSize;
[SerializeField] TMPro.TextMeshPro damageText;
public void Init(float damage)
{
transform.localScale = Vector2.one * damageToSize.Evaluate(damage);
damageText.text = damage.ToString();
}
}