Threepeater added and line system removed
This commit is contained in:
parent
8fdc2a3ed9
commit
b5d2466be4
16 changed files with 131 additions and 209 deletions
|
|
@ -4,14 +4,19 @@ namespace Newlon.Components.Plants.Behaviours;
|
|||
|
||||
public partial class PeashooterBehaviour : Node
|
||||
{
|
||||
[Export] private AnimationTree _animationTree;
|
||||
[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;
|
||||
|
||||
_animationTree.Set("parameters/conditions/ready", readyToShoot);
|
||||
|
||||
if(readyToShoot)
|
||||
{
|
||||
_player.Play(_libName+"/shoot");
|
||||
_player.Queue(_libName+"/idle");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue