mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-05 07:41:10 +00:00
update: add teleport systems for entity
This commit is contained in:
@@ -17,7 +17,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Energy
|
||||
public class RegenEnergyEvent : IEntityComponent { public ReactiveEvent<int> Value; }
|
||||
|
||||
public class AutoRegenEnergyAmount : IEntityComponent { public ReactiveVariable<int> Value; }
|
||||
public class InAutoRegenEnergy : IEntityComponent { public ReactiveVariable<bool> Value; }
|
||||
public class IsAutoRegenEnergy : IEntityComponent { public ReactiveVariable<bool> Value; }
|
||||
public class EnergyAutoRegenInitialTime : IEntityComponent { public ReactiveVariable<float> Value; }
|
||||
public class EnergyAutoRegenCurrentTime : IEntityComponent { public ReactiveVariable<float> Value; }
|
||||
}
|
||||
@@ -13,11 +13,11 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Energy.Systems
|
||||
|
||||
private ReactiveVariable<int> _regenAmount;
|
||||
|
||||
private ReactiveVariable<bool> _inAutoRegen;
|
||||
private ReactiveVariable<bool> _isAutoRegen;
|
||||
|
||||
public void OnInit(Entity entity)
|
||||
{
|
||||
_inAutoRegen = entity.InAutoRegenEnergy;
|
||||
_isAutoRegen = entity.IsAutoRegenEnergy;
|
||||
_regenAmount = entity.AutoRegenEnergyAmount;
|
||||
|
||||
_initialTime = entity.EnergyAutoRegenInitialTime;
|
||||
@@ -26,7 +26,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Energy.Systems
|
||||
|
||||
public void OnUpdate(float deltaTime)
|
||||
{
|
||||
if (_inAutoRegen.Value == false)
|
||||
if (_isAutoRegen.Value == false)
|
||||
return;
|
||||
|
||||
_currentTime.Value += deltaTime;
|
||||
|
||||
Reference in New Issue
Block a user