18 lines
413 B
C#
18 lines
413 B
C#
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);
|
|
}
|
|
}
|