Animations improved

This commit is contained in:
Фёдор Веселов 2024-10-07 00:05:10 +05:00
commit ad18793543
35 changed files with 430 additions and 465 deletions

View file

@ -0,0 +1,18 @@
using Godot;
namespace Newlon.Components.Plants.Behaviours;
public partial class HpBasedBehaviour : BaseBehaviour
{
private RuntimePlantData _data;
public override void _Ready()
{
base._Ready();
_data = GetParent<RuntimePlantData>();
}
public void OnHPChanged(int amount,Node origin)
{
_tree.Set("parameters/blend_position",(float)_data.Hp/_data.MaxHp);
}
}