Returns a new
SignalAwaiter awaiter configured to complete when the instance
source emits the signal specified by the
signal parameter.
Namespace:
Godot
Assembly:
GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax public SignalAwaiter ToSignal(
Object source,
string signal
)
Parameters
- source
- Type: GodotObject
The instance the awaiter will be listening to.
- signal
- Type: SystemString
The signal the awaiter will be waiting for.
Return Value
Type:
SignalAwaiter[Missing <returns> documentation for "M:Godot.Object.ToSignal(Godot.Object,System.String)"]
Examples
This sample prints a message once every frame up to 100 times.
public override void _Ready()
{
for (int i = 0; i < 100; i++)
{
await ToSignal(GetTree(), "idle_frame");
GD.Print($"Frame {i}");
}
}
See Also