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

16 lines
418 B
C#

using Godot;
namespace Newlon.Components.Plants.Behaviours;
public partial class PeashooterBehaviour : BaseBehaviour
{
[Export] private Timer _shootTimer;
[Export] private Eyesight _sight;
public override void _Process(double delta)
{
bool readyToShoot = _sight.EnemyDetected && _shootTimer.TimeLeft <= 0;
_tree.Set("parameters/Tree/conditions/ready",readyToShoot);
}
}