hotbar resize
This commit is contained in:
parent
27d839b86f
commit
1cd9ef3f3a
9 changed files with 55 additions and 23 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Godot;
|
||||
using Godot.Collections;
|
||||
using Newlon.Components.Level;
|
||||
using Newlon.Systems.Effects;
|
||||
|
||||
namespace Newlon.Components;
|
||||
|
|
@ -58,22 +59,30 @@ public partial class Entity : Node2D
|
|||
#region Brain
|
||||
[Export] private AnimationPlayer _player;
|
||||
[Export] private AnimationTree _tree;
|
||||
public virtual void DisableBrain()
|
||||
private bool forceToggledBrain = false;
|
||||
private bool brainEnabled = true;
|
||||
public virtual void DisableBrain(bool force = true)
|
||||
{
|
||||
if (brainEnabled == false) return;
|
||||
if (_player != null)
|
||||
_player.ProcessMode = ProcessModeEnum.Pausable;
|
||||
if (_tree != null)
|
||||
_tree.ProcessMode = ProcessModeEnum.Pausable;
|
||||
ProcessMode = ProcessModeEnum.Disabled;
|
||||
forceToggledBrain = force;
|
||||
brainEnabled = false;
|
||||
}
|
||||
|
||||
public virtual void EnableBrain()
|
||||
public virtual void EnableBrain(bool force = true)
|
||||
{
|
||||
if (brainEnabled) return;
|
||||
if (_player != null)
|
||||
_player.ProcessMode = ProcessModeEnum.Inherit;
|
||||
if (_tree != null)
|
||||
_tree.ProcessMode = ProcessModeEnum.Inherit;
|
||||
ProcessMode = ProcessModeEnum.Inherit;
|
||||
forceToggledBrain = force;
|
||||
brainEnabled = true;
|
||||
}
|
||||
#endregion
|
||||
#region Effects
|
||||
|
|
@ -171,6 +180,11 @@ public partial class Entity : Node2D
|
|||
public override void _Ready()
|
||||
{
|
||||
HP = MaxHP;
|
||||
if (RuntimeLevelData.Instance != null)
|
||||
{
|
||||
if (RuntimeLevelData.Instance.GetLevelState() != RuntimeLevelData.LevelStates.Game) DisableBrain(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue