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

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