How to determine exactly which animation is finished in c#?

Godot Version

4.2.2 mono

Question

i was reading another topics but only seen solutions in gdscript, so how do i determine exactly which animation is emitted animation_finished signal in AnimatedSprite2D using c#? the signal is void, its not passing anything.
ive seen on gdscript you should pass animation from animation_finished to your custom signal , but where do i get it? can i see code example?

Ive also just been using AnimatedSprite2D (not animationPlayer) and my signal does not pass any animation name at all. What i do is just put an if $Sprite.animation == “” within the signal created when connecting

obraz
You can pick any method with correct arguments type and numbers

AnimationPlayer has animation_finished with stringname in it, but according to docs animatedSprite2D has no methods that would pass the animation name

using Godot;
namespace MyGame;
public partial class TestAnimatedSprite2D : AnimatedSprite2D
{
	[Signal] public delegate void OnAnimationChangedCallEventHandler(Node node);
	public override void _EnterTree() => AnimationChanged += OnAnimationChanged;
	public override void _ExitTree() => AnimationChanged -= OnAnimationChanged;
	private void OnAnimationChanged() => EmitSignal(SignalName.OnAnimationChangedCall, this);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.