rabidus-test/Assets/Scripts/EnergyController.cs

23 lines
425 B
C#
Raw Normal View History

2023-07-28 11:48:57 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class EnergyController : MonoBehaviour
{
[SerializeField]
private float _energy;
public event UnityAction<float> OnEnergyChange;
public float Energy
{
get => _energy;
set
{
_energy = value;
OnEnergyChange?.Invoke(_energy);
}
}
}