This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

C# how can I evaluate signals in one specific place

Natt007Natt007 Posts: 2Member

I want to simplify the code to avoid splitting the code up in different locations.
I have problems figuring out how to do that with signals.
For example, I had to figure out another way to determine "animation_finished" in AnimatedSprite

    if(sp.Frame == sp.Frames.GetFrameCount(sp.Animation)-1)
    {
            sp.Play("fall");

    }

I want something like this to work:
(async()=> { await ToSignal(sp,"animation_finished"); GD.Print("animation_finished"); });

Not sure about the right syntax.
I really appreciate it if you can help me with this.
Kindly Natt

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.