Animations improved
This commit is contained in:
parent
c89d93cf24
commit
ad18793543
35 changed files with 430 additions and 465 deletions
|
|
@ -2,21 +2,15 @@ using Godot;
|
|||
|
||||
namespace Newlon.Components.Plants.Behaviours;
|
||||
|
||||
public partial class PeashooterBehaviour : Node
|
||||
public partial class PeashooterBehaviour : BaseBehaviour
|
||||
{
|
||||
[Export] private AnimationPlayer _player;
|
||||
[Export] private Timer _shootTimer;
|
||||
[Export] private Eyesight _sight;
|
||||
[Export] private string _libName;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
bool readyToShoot = _sight.EnemyDetected && _shootTimer.TimeLeft <= 0;
|
||||
|
||||
if(readyToShoot)
|
||||
{
|
||||
_player.Play(_libName+"/shoot");
|
||||
_player.Queue(_libName+"/idle");
|
||||
}
|
||||
_tree.Set("parameters/conditions/ready",readyToShoot);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue