newlon/scripts/components/plants/behaviours/SpikeweedBehaviour.cs

21 lines
415 B
C#

using Godot;
namespace Newlon.Components.Plants.Behaviours;
public partial class SpikeweedBehaviour : Node
{
[Export] private AnimationTree _tree;
private int _inCount = 0;
public void OnHitboxEntered(Area2D _area)
{
if (_inCount++ == 0)
_tree.Set("parameters/blend_position",1);
}
public void OnHitboxExited(Area2D _area)
{
if (--_inCount == 0)
_tree.Set("parameters/blend_position",0);
}
}