28 lines
693 B
C#
28 lines
693 B
C#
using UnityEngine;
|
|
|
|
namespace OTG.Lab06.Combat
|
|
{
|
|
public sealed class FloatingDamageManager : MonoBehaviour
|
|
{
|
|
private static FloatingDamageManager instance;
|
|
|
|
[SerializeField] private FloatingDamage floatingDamagePrefab;
|
|
|
|
private void Awake()
|
|
{
|
|
instance = this;
|
|
}
|
|
|
|
public static void Show(float amount, Vector3 position)
|
|
{
|
|
if (instance == null || instance.floatingDamagePrefab == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
FloatingDamage damage = Instantiate(instance.floatingDamagePrefab, position, Quaternion.identity);
|
|
damage.Initialize(amount);
|
|
}
|
|
}
|
|
}
|