Plants animation now supports timescale
This commit is contained in:
parent
5fe7cb7d68
commit
e7a9860a54
18 changed files with 141 additions and 60 deletions
|
|
@ -2,20 +2,18 @@ using Godot;
|
|||
|
||||
namespace Newlon.Components.Plants.Behaviours;
|
||||
|
||||
public partial class SpikeweedBehaviour : Node
|
||||
public partial class SpikeweedBehaviour : BaseBehaviour
|
||||
{
|
||||
[Export] private AnimationTree _tree;
|
||||
|
||||
private int _inCount = 0;
|
||||
public void OnHitboxEntered(Area2D _area)
|
||||
{
|
||||
if (_inCount++ == 0)
|
||||
_tree.Set("parameters/blend_position",1);
|
||||
_tree.Set("parameters/Tree/blend_position",1);
|
||||
}
|
||||
|
||||
public void OnHitboxExited(Area2D _area)
|
||||
{
|
||||
if (--_inCount == 0)
|
||||
_tree.Set("parameters/blend_position",0);
|
||||
_tree.Set("parameters/Tree/blend_position",0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue