Initial commit
This commit is contained in:
commit
c266d22f58
85 changed files with 1649 additions and 0 deletions
16
scripts/components/plants/behaviours/PeashooterBehaviour.cs
Normal file
16
scripts/components/plants/behaviours/PeashooterBehaviour.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class PeashooterBehaviour : Node
|
||||
{
|
||||
[Export] private AnimationTree _animationTree;
|
||||
[Export] private Timer _shootTimer;
|
||||
[Export] private Eyesight _sight;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
bool readyToShoot = _sight.EnemyDetected && _shootTimer.TimeLeft <= 0;
|
||||
|
||||
_animationTree.Set("parameters/conditions/ready", readyToShoot);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue