|
|
|
|
@ -12,13 +12,20 @@ public partial class MVPDuck : Node2D
|
|
|
|
|
[Export] private int _transferDelayMs;
|
|
|
|
|
[Export] private AnimationPlayer _animationPlayer;
|
|
|
|
|
[Export] private string _flapAnimationName = "flapFlap";
|
|
|
|
|
|
|
|
|
|
private bool _collected;
|
|
|
|
|
|
|
|
|
|
[Signal] public delegate void DuckCollectedEventHandler();
|
|
|
|
|
|
|
|
|
|
public void TransferToTargetAfterDelay()
|
|
|
|
|
{
|
|
|
|
|
MoveAfterDelay();
|
|
|
|
|
PlayAnimation();
|
|
|
|
|
if (!_collected)
|
|
|
|
|
{
|
|
|
|
|
MoveAfterDelay();
|
|
|
|
|
PlayAnimation();
|
|
|
|
|
_collected = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PlayAnimation()
|
|
|
|
|
|