20 lines
347 B
C#
20 lines
347 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class SpikeweedBehaviour : Node
|
|
{
|
|
[Export] private AnimationPlayer _player;
|
|
|
|
private int _inCount = 0;
|
|
public void OnHitboxEntered(Area2D _area)
|
|
{
|
|
if (_inCount++ == 0)
|
|
_player.Play("attack");
|
|
}
|
|
|
|
public void OnHitboxExited(Area2D _area)
|
|
{
|
|
if (--_inCount == 0)
|
|
_player.Play("idle");
|
|
}
|
|
}
|