17 lines
407 B
C#
17 lines
407 B
C#
|
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();
|
||
|
}
|
||
|
}
|