Animations improved
This commit is contained in:
parent
c89d93cf24
commit
ad18793543
35 changed files with 430 additions and 465 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue